@jayfong/x-server 1.26.9 → 1.27.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [1.27.0](https://github.com/jfWorks/x-server/compare/v1.26.9...v1.27.0) (2022-05-07)
6
+
7
+
8
+ ### Features
9
+
10
+ * 添加 fastifyOptions ([0be0509](https://github.com/jfWorks/x-server/commit/0be0509adb2bfcc24ff0122b1f5d52a155370738))
11
+
5
12
  ### [1.26.9](https://github.com/jfWorks/x-server/compare/v1.26.8...v1.26.9) (2022-05-07)
6
13
 
7
14
 
@@ -45,7 +45,8 @@ class Server {
45
45
  this.fastify = (0, _fastify.default)({
46
46
  logger: process.env.NODE_ENV === 'development' ? {
47
47
  prettyPrint: true
48
- } : false
48
+ } : false,
49
+ ...this.options.fastifyOptions
49
50
  });
50
51
  }
51
52
 
@@ -32,7 +32,8 @@ export class Server {
32
32
  this.fastify = Fastify({
33
33
  logger: process.env.NODE_ENV === 'development' ? {
34
34
  prettyPrint: true
35
- } : false
35
+ } : false,
36
+ ...this.options.fastifyOptions
36
37
  });
37
38
  }
38
39
 
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import { BasePlugin } from '../plugins/base';
3
3
  import { BaseService } from '../services/base';
4
- import { FastifyReply, FastifyRequest } from 'fastify';
4
+ import { FastifyReply, FastifyRequest, FastifyServerOptions } from 'fastify';
5
5
  import { yup } from 'vtils/validator';
6
6
  import type { AsyncOrSync, LiteralUnion, OneOrMore, RequiredDeep } from 'vtils/types';
7
7
  import type { DisposeService } from '../services/dispose';
@@ -31,6 +31,10 @@ export declare namespace XServer {
31
31
  * 监听端口
32
32
  */
33
33
  port: number;
34
+ /**
35
+ * 透传给 Fastify 的选项
36
+ */
37
+ fastifyOptions?: FastifyServerOptions;
34
38
  /**
35
39
  * 服务列表
36
40
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jayfong/x-server",
3
- "version": "1.26.9",
3
+ "version": "1.27.0",
4
4
  "license": "ISC",
5
5
  "sideEffects": false,
6
6
  "main": "lib/_cjs/index.js",