@thzero/library_server_fastify 0.15.37 → 0.15.38

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.
Files changed (2) hide show
  1. package/boot/index.js +14 -5
  2. package/package.json +3 -3
package/boot/index.js CHANGED
@@ -9,7 +9,6 @@ import fastifyRoutes from 'fastify-routes';
9
9
  import fastifyStatic from 'fastify-static';
10
10
 
11
11
  import LibraryConstants from '@thzero/library_server/constants';
12
- import LibraryCommonServiceConstants from '@thzero/library_common_service/constants';
13
12
 
14
13
  import injector from '@thzero/library_common/utility/injector';
15
14
 
@@ -33,9 +32,15 @@ class FastifyBootMain extends BootMain {
33
32
 
34
33
  // return server;
35
34
  // };
35
+
36
+ let http2 = this._appConfig.get('http2', false);
37
+ http2 = http2 === 'true' ? true : false;
36
38
 
37
39
  // const fastify = Fastify({ serverFactory, logger: true });
38
- const fastify = Fastify({ logger: true });
40
+ const fastify = Fastify({
41
+ http2: http2,
42
+ logger: true
43
+ });
39
44
  const serverHttp = fastify.server;
40
45
 
41
46
  await fastify.register(fastifyRoutes);
@@ -302,7 +307,11 @@ class FastifyBootMain extends BootMain {
302
307
  usageMetrics: this.usageMetricsServiceI
303
308
  });
304
309
 
305
- return { app: fastify, server: serverHttp, listen: fastify.listen };
310
+ return {
311
+ app: fastify,
312
+ server: serverHttp,
313
+ listen: fastify.listen
314
+ };
306
315
  }
307
316
 
308
317
  _initAuthentication(map) {
@@ -315,8 +324,8 @@ class FastifyBootMain extends BootMain {
315
324
  return map;
316
325
  }
317
326
 
318
- _initAppListen(app, server, port, err) {
319
- app.listen(port, err);
327
+ _initAppListen(app, server, address, port, err) {
328
+ app.listen(port, address, err);
320
329
  }
321
330
 
322
331
  async _initAppPost(app, args) {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@thzero/library_server_fastify",
3
3
  "type": "module",
4
- "version": "0.15.37",
4
+ "version": "0.15.38",
5
5
  "version_major": 0,
6
6
  "version_minor": 15,
7
- "version_patch": 37,
8
- "version_date": "04/24/2022",
7
+ "version_patch": 38,
8
+ "version_date": "04/25/2022",
9
9
  "description": "An opinionated library of common functionality to bootstrap a Fastify based API application.",
10
10
  "author": "thZero",
11
11
  "license": "MIT",