Skip to content

Commit 5d800f7

Browse files
committed
fix(http): pass app to attach for simplicity
1 parent 1ffe3f5 commit 5d800f7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/express-app/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ export async function listen<SLocals extends AnyServiceLocals = ServiceLocals<Co
303303

304304
const { service, logger } = app.locals;
305305
const server = httpServer(app, config);
306-
await app.locals.service.attachServer?.(server);
306+
await app.locals.service.attachServer?.(app, server);
307307

308308
let shutdownInProgress = false;
309309
createTerminus(server, {

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export interface Service<
7777
attach?: (app: ServiceExpress<SLocals>) => void | Promise<void>;
7878

7979
// Called after a server is created but before the server starts listening
80-
attachServer?: (server: Server) => void | Promise<void>;
80+
attachServer?: (app: ServiceExpress<SLocals>, server: Server) => void | Promise<void>;
8181

8282
start(app: ServiceExpress<SLocals>): void | Promise<void>;
8383

0 commit comments

Comments
 (0)