rlz-engine 1.0.28 → 1.0.29
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.js +5 -0
- package/package.json +1 -1
package/dist/back/server.js
CHANGED
|
@@ -11,7 +11,9 @@ import { installIntoGlobal } from 'iterator-helpers-polyfill';
|
|
|
11
11
|
import path from 'path';
|
|
12
12
|
import { logger } from './logger';
|
|
13
13
|
installIntoGlobal();
|
|
14
|
+
const L = logger('init');
|
|
14
15
|
export async function runServer({ production, domain, certDir, staticDir, init }) {
|
|
16
|
+
L.info({ production }, 'runServer');
|
|
15
17
|
const httpServer = fastify({
|
|
16
18
|
loggerInstance: logger('http'),
|
|
17
19
|
ajv: { plugins: [formatsPlugin] }
|
|
@@ -35,7 +37,9 @@ export async function runServer({ production, domain, certDir, staticDir, init }
|
|
|
35
37
|
}
|
|
36
38
|
httpServer.register(fastifyAcmeUnsecurePlugin, { redirectDomain: domain });
|
|
37
39
|
await httpServer.listen({ port: 80, host: '::' });
|
|
40
|
+
L.info('Get certificates');
|
|
38
41
|
const certAndKey = await getCertAndKey(certDir, domain);
|
|
42
|
+
L.info('Init secure server');
|
|
39
43
|
const httpsServer = fastify({
|
|
40
44
|
http2: true,
|
|
41
45
|
https: {
|
|
@@ -62,6 +66,7 @@ export async function runServer({ production, domain, certDir, staticDir, init }
|
|
|
62
66
|
});
|
|
63
67
|
addStaticEndpoints(httpsServer, staticDir);
|
|
64
68
|
await httpsServer.listen({ port: 443, host: '::' });
|
|
69
|
+
L.info('runServer done');
|
|
65
70
|
}
|
|
66
71
|
function addStaticEndpoints(server, staticPath) {
|
|
67
72
|
const absStaticPath = path.resolve(staticPath);
|