Skip to content

Commit 48e41f1

Browse files
authored
Return http.Server instance from listen
Return the `http.Server` instance from `listen` to [match the return value of the same function in express](https://github.com/expressjs/express/blob/31dd549f350accd7b4e3685c13f745e857557827/lib/application.js#L617).
1 parent 2f02d0c commit 48e41f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Server.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ Server.prototype.setContentHeaders = function(req, res, next) {
311311

312312
// delegate listen call and init sockjs
313313
Server.prototype.listen = function() {
314-
this.listeningApp.listen.apply(this.listeningApp, arguments);
314+
var returnValue = this.listeningApp.listen.apply(this.listeningApp, arguments);
315315
var sockServer = sockjs.createServer({
316316
// Limit useless logs
317317
log: function(severity, line) {
@@ -339,6 +339,7 @@ Server.prototype.listen = function() {
339339
sockServer.installHandlers(this.listeningApp, {
340340
prefix: '/sockjs-node'
341341
});
342+
return returnValue;
342343
}
343344

344345
Server.prototype.close = function() {

0 commit comments

Comments
 (0)