We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e6477d commit b506c6aCopy full SHA for b506c6a
src/express-app/app.ts
@@ -429,6 +429,7 @@ export async function listen<SLocals extends AnyServiceLocals = ServiceLocals<Co
429
});
430
431
await listenPromise;
432
+ await service.onListening?.(app, port);
433
return server;
434
}
435
src/types.ts
@@ -78,6 +78,8 @@ export interface Service<
78
79
// Called after a server is created but before the server starts listening
80
attachServer?: (app: ServiceExpress<SLocals>, server: Server) => void | Promise<void>;
81
+ // Called after the server is listening
82
+ onListening?: (app: ServiceExpress<SLocals>, port: number) => void | Promise<void>;
83
84
start(app: ServiceExpress<SLocals>): void | Promise<void>;
85
0 commit comments