@gasket/plugin-fastify 7.0.1 → 7.0.3
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/README.md +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ All the configurations for the plugin are added under `fastify` in the config:
|
|
|
31
31
|
- `compression`: true by default. Can be set to false if applying compression
|
|
32
32
|
differently.
|
|
33
33
|
- `trustProxy`: Enable trust proxy option, [see Fastify documentation for possible values](https://fastify.dev/docs/latest/Reference/Server/#trustproxy)
|
|
34
|
+
- `disableRequestLogging`: Turn off request logging, true by default
|
|
34
35
|
|
|
35
36
|
#### Example configuration
|
|
36
37
|
|
package/lib/index.d.ts
CHANGED
|
@@ -29,6 +29,8 @@ declare module '@gasket/core' {
|
|
|
29
29
|
excludedRoutesRegex?: RegExp;
|
|
30
30
|
/** Trust proxy configuration */
|
|
31
31
|
trustProxy?: FastifyServerOptions['trustProxy'];
|
|
32
|
+
/** Fastify request logging per route */
|
|
33
|
+
disableRequestLogging?: boolean;
|
|
32
34
|
};
|
|
33
35
|
/** Middleware configuration */
|
|
34
36
|
middleware?: {
|
package/lib/index.js
CHANGED
|
@@ -21,11 +21,11 @@ const plugin = {
|
|
|
21
21
|
actions: {
|
|
22
22
|
getFastifyApp(gasket) {
|
|
23
23
|
const { fastify: fastifyConfig = {}, http2, https } = gasket.config;
|
|
24
|
-
const { trustProxy = false } = fastifyConfig;
|
|
24
|
+
const { trustProxy = false, disableRequestLogging = true } = fastifyConfig;
|
|
25
25
|
const fastifyLogger = alignLogger(gasket.logger);
|
|
26
26
|
|
|
27
27
|
// @ts-ignore
|
|
28
|
-
app ??= fastify({ logger: fastifyLogger, trustProxy, https, http2 });
|
|
28
|
+
app ??= fastify({ logger: fastifyLogger, trustProxy, https, http2, disableRequestLogging });
|
|
29
29
|
|
|
30
30
|
return app;
|
|
31
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/plugin-fastify",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3",
|
|
4
4
|
"description": "Adds fastify support to your application",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"jest": {
|
|
73
73
|
"rootDir": "test"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "b023043d772b31c25dfd49e6b17bfb21ad54555d"
|
|
76
76
|
}
|