rlz-engine 1.0.44 → 1.0.45
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/dist/back/server.d.ts +1 -1
- package/dist/back/server.js +9 -1
- package/package.json +1 -1
package/dist/back/server.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export interface RunServerParams {
|
|
|
8
8
|
staticDir: string;
|
|
9
9
|
init: InitServerFuncType;
|
|
10
10
|
}
|
|
11
|
-
export declare function runServer({ production, domain, certDir, staticDir, init }: RunServerParams): Promise<void
|
|
11
|
+
export declare function runServer({ production, domain, certDir, staticDir, init }: RunServerParams): Promise<() => Promise<void>>;
|
package/dist/back/server.js
CHANGED
|
@@ -33,7 +33,9 @@ export async function runServer({ production, domain, certDir, staticDir, init }
|
|
|
33
33
|
});
|
|
34
34
|
addStaticEndpoints(httpServer, staticDir);
|
|
35
35
|
await httpServer.listen({ port: 8080 });
|
|
36
|
-
return
|
|
36
|
+
return async () => {
|
|
37
|
+
await httpServer.close();
|
|
38
|
+
};
|
|
37
39
|
}
|
|
38
40
|
httpServer.register(fastifyAcmeUnsecurePlugin, { redirectDomain: domain });
|
|
39
41
|
await httpServer.listen({ port: 80, host: '::' });
|
|
@@ -67,6 +69,12 @@ export async function runServer({ production, domain, certDir, staticDir, init }
|
|
|
67
69
|
addStaticEndpoints(httpsServer, staticDir);
|
|
68
70
|
await httpsServer.listen({ port: 443, host: '::' });
|
|
69
71
|
L.info('runServer done');
|
|
72
|
+
return async () => {
|
|
73
|
+
await Promise.all([
|
|
74
|
+
httpServer.close(),
|
|
75
|
+
httpsServer.close()
|
|
76
|
+
]);
|
|
77
|
+
};
|
|
70
78
|
}
|
|
71
79
|
function addStaticEndpoints(server, staticPath) {
|
|
72
80
|
const absStaticPath = path.resolve(staticPath);
|