mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-05 16:10:11 +08:00
Return http.Server from express.listen()
This commit is contained in:
@@ -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();
|
||||
|
||||
Vendored
+5
-5
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user