Skip to content

Commit 39f418f

Browse files
committed
add close() api
1 parent c52035e commit 39f418f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Server.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ Server.prototype.listen = function() {
271271
}.bind(this));
272272
}
273273

274+
Server.prototype.close = function() {
275+
this.io.close(); // Will also close listeningApp
276+
this.middleware.close();
277+
}
278+
274279
Server.prototype.serveMagicHtml = function(req, res, next) {
275280
var _path = req.path;
276281
try {

0 commit comments

Comments
 (0)