root 3bf41bf355 update | 1 year ago | |
---|---|---|
.. | ||
LICENSE | 1 year ago | |
README.md | 1 year ago | |
index.js | 1 year ago | |
package.json | 1 year ago | |
test.js | 1 year ago |
Enable destroying a server, and all currently open connections.
var enableDestroy = require('server-destroy');
var server = http.createServer(function(req, res) {
// do stuff, blah blah blah
});
server.listen(PORT);
// enhance with a 'destroy' function
enableDestroy(server);
// some time later...
server.destroy();