Reputation: 116293
I have an http server listening on port 80:
require('http').createServer(app).listen(80);
How can I programmatically make it unlisten port 80 after, say, 10 seconds?
Upvotes: 1
Views: 547
Reputation: 123
If you want the server running, change the port:
setTimeout(function() {
app.set('port', 1337);
}, 10000);
Something like that?
Upvotes: 1