File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1
1
// @ts -check
2
+ const fp = require ( 'fastify-plugin' ) . default ;
2
3
const configureAWSXRaySync = require ( './private/configure-aws-x-ray-sync' ) ;
3
4
const onRequestHook = require ( './hooks/on-request.hook' ) ;
4
5
const onResponseHook = require ( './hooks/on-response.hook' ) ;
5
6
const onErrorHook = require ( './hooks/on-error.hook' ) ;
6
7
7
8
/** @type {import('fastify').FastifyPluginAsync } */
8
- const xRayFastifyPlugin = async ( fastify , opts ) => {
9
+ const xRayFastifyPlugin = fp ( async ( fastify , opts ) => {
9
10
configureAWSXRaySync ( fastify , opts ) ;
10
11
11
12
fastify . decorateRequest ( 'segment' , null ) ;
12
13
fastify
13
14
. addHook ( 'onRequest' , onRequestHook )
14
15
. addHook ( 'onResponse' , onResponseHook )
15
16
. addHook ( 'onError' , onErrorHook ) ;
16
- } ;
17
+ } ) ;
17
18
18
19
module . exports = xRayFastifyPlugin ;
19
20
You can’t perform that action at this time.
0 commit comments