rlz-engine 0.0.5 → 0.0.7

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.
@@ -12,6 +12,8 @@ import path from 'path';
12
12
  import { logger } from './logger';
13
13
  installIntoGlobal();
14
14
  export async function runServer({ production, domain, certDir, staticDir, init }) {
15
+ const l = logger('runServer');
16
+ l.info('Starting server', { production, domain, certDir, staticDir });
15
17
  const httpServer = fastify({
16
18
  loggerInstance: logger('http'),
17
19
  ajv: { plugins: [formatsPlugin] }
@@ -30,11 +32,12 @@ export async function runServer({ production, domain, certDir, staticDir, init }
30
32
  return httpErrors.notFound();
31
33
  });
32
34
  addStaticEndpoints(httpServer, staticDir);
33
- await httpServer.listen({ host: 'localhost', port: 8080 });
35
+ await httpServer.listen({ port: 8080 });
34
36
  return;
35
37
  }
36
38
  httpServer.register(fastifyAcmeUnsecurePlugin, { redirectDomain: domain });
37
- await httpServer.listen({ port: 80 });
39
+ await httpServer.listen({ port: 80, host: '::' });
40
+ l.info('Getting cert and key');
38
41
  const certAndKey = await getCertAndKey(certDir, domain);
39
42
  const httpsServer = fastify({
40
43
  http2: true,
@@ -61,6 +64,8 @@ export async function runServer({ production, domain, certDir, staticDir, init }
61
64
  return httpErrors.notFound();
62
65
  });
63
66
  addStaticEndpoints(httpsServer, staticDir);
67
+ await httpsServer.listen({ port: 443, host: '::' });
68
+ l.info('Server started');
64
69
  }
65
70
  function addStaticEndpoints(server, staticPath) {
66
71
  const absStaticPath = path.resolve(staticPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rlz-engine",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "Deps and tools for my style of development",
5
5
  "scripts": {
6
6
  "build": "tsc",