Return http.Server from express.listen()

This commit is contained in:
John Purcell
2014-03-26 15:07:49 -04:00
parent cb01abe1b2
commit f5b19e8dd7
2 changed files with 12 additions and 5 deletions
+7
View File
@@ -1489,3 +1489,10 @@ function test_middleware() {
app.use(express.static('public'));
app.use(router.middleware);
}
////////////////////
// make sure server can be shut down
var testShutdownServer = app.listen(0);
console.log('listening on port ' + testShutdownServer.address().port);
testShutdownServer.close();
+5 -5
View File
@@ -1112,15 +1112,15 @@ declare module "express" {
* http.createServer(app).listen(80);
* https.createServer({ ... }, app).listen(443);
*/
listen(port: number, hostname: string, backlog: number, callback?: Function): void;
listen(port: number, hostname: string, backlog: number, callback?: Function): http.Server;
listen(port: number, hostname: string, callback?: Function): void;
listen(port: number, hostname: string, callback?: Function): http.Server;
listen(port: number, callback?: Function): void;
listen(port: number, callback?: Function): http.Server;
listen(path: string, callback?: Function): void;
listen(path: string, callback?: Function): http.Server;
listen(handle: any, listeningListener?: Function): void;
listen(handle: any, listeningListener?: Function): http.Server;
route: IRoute;