Open mellis481 opened 3 years ago
I'd essentially like to create a throttled server. I thought I could do something like this:
require('http').createServer(function (request, response) { request.addListener('end', function () { setTimeout(function () { fileServer.serve(request, response); }, 2000); }).resume(); }).listen(8080);
As you can see, I've wrapped my server() call in a setTimeout. This doesn't seem to be working, though.
server()
setTimeout
How can I throttle my server?
I'd essentially like to create a throttled server. I thought I could do something like this:
As you can see, I've wrapped my
server()
call in asetTimeout
. This doesn't seem to be working, though.How can I throttle my server?