improve(api): update api to fastify v5
This commit is contained in:
@@ -2,9 +2,11 @@ import { handler } from '@/controllers/track.controller';
|
||||
import type { FastifyPluginCallback } from 'fastify';
|
||||
|
||||
import { clientHook } from '@/hooks/client.hook';
|
||||
import { deduplicateHook } from '@/hooks/deduplicate.hook';
|
||||
import { isBotHook } from '@/hooks/is-bot.hook';
|
||||
|
||||
const trackRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
const trackRouter: FastifyPluginCallback = (fastify) => {
|
||||
fastify.addHook('preHandler', deduplicateHook);
|
||||
fastify.addHook('preHandler', clientHook);
|
||||
fastify.addHook('preHandler', isBotHook);
|
||||
|
||||
@@ -29,8 +31,6 @@ const trackRouter: FastifyPluginCallback = (fastify, opts, done) => {
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
done();
|
||||
};
|
||||
|
||||
export default trackRouter;
|
||||
|
||||
Reference in New Issue
Block a user