@openapi-typescript-infra/service 5.13.0 → 5.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/types.d.ts
CHANGED
|
@@ -42,7 +42,10 @@ export interface Service<SLocals extends AnyServiceLocals = ServiceLocals<Config
|
|
|
42
42
|
configure?: (startOptions: ServiceStartOptions<SLocals, RLocals>, options: ServiceOptions) => ServiceOptions;
|
|
43
43
|
attach?: (app: ServiceExpress<SLocals>) => void | Promise<void>;
|
|
44
44
|
attachServer?: (app: ServiceExpress<SLocals>, server: Server) => void | Promise<void>;
|
|
45
|
-
onListening?: (app: ServiceExpress<SLocals>,
|
|
45
|
+
onListening?: (app: ServiceExpress<SLocals>, info: {
|
|
46
|
+
port: number;
|
|
47
|
+
protocol: 'http' | 'https';
|
|
48
|
+
}) => void | Promise<void>;
|
|
46
49
|
start(app: ServiceExpress<SLocals>): void | Promise<void>;
|
|
47
50
|
stop?: (app: ServiceExpress<SLocals>) => void | Promise<void>;
|
|
48
51
|
healthy?: (app: ServiceExpress<SLocals>) => boolean | Promise<boolean>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openapi-typescript-infra/service",
|
|
3
|
-
"version": "5.13.
|
|
3
|
+
"version": "5.13.1",
|
|
4
4
|
"description": "An opinionated framework for building configuration driven services - web, api, or ob. Uses OpenAPI, pino logging, express, confit, Typescript and vitest.",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
package/src/express-app/app.ts
CHANGED
|
@@ -429,7 +429,7 @@ export async function listen<SLocals extends AnyServiceLocals = ServiceLocals<Co
|
|
|
429
429
|
});
|
|
430
430
|
|
|
431
431
|
await listenPromise;
|
|
432
|
-
await service.onListening?.(app, port);
|
|
432
|
+
await service.onListening?.(app, { port, protocol: config.certificate ? 'https' : 'http' });
|
|
433
433
|
return server;
|
|
434
434
|
}
|
|
435
435
|
|
package/src/types.ts
CHANGED
|
@@ -79,7 +79,10 @@ export interface Service<
|
|
|
79
79
|
// Called after a server is created but before the server starts listening
|
|
80
80
|
attachServer?: (app: ServiceExpress<SLocals>, server: Server) => void | Promise<void>;
|
|
81
81
|
// Called after the server is listening
|
|
82
|
-
onListening?: (
|
|
82
|
+
onListening?: (
|
|
83
|
+
app: ServiceExpress<SLocals>,
|
|
84
|
+
info: { port: number; protocol: 'http' | 'https' },
|
|
85
|
+
) => void | Promise<void>;
|
|
83
86
|
|
|
84
87
|
start(app: ServiceExpress<SLocals>): void | Promise<void>;
|
|
85
88
|
|