improve(api): update api to fastify v5

This commit is contained in:
Carl-Gerhard Lindesvärd
2025-02-28 09:19:27 +01:00
parent f0b0f27a8f
commit 7750ca117f
25 changed files with 520 additions and 1642 deletions

View File

@@ -1,9 +1,11 @@
import * as controller from '@/controllers/profile.controller';
import { clientHook } from '@/hooks/client.hook';
import { deduplicateHook } from '@/hooks/deduplicate.hook';
import { isBotHook } from '@/hooks/is-bot.hook';
import type { FastifyPluginCallback } from 'fastify';
const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
const eventRouter: FastifyPluginCallback = async (fastify) => {
fastify.addHook('preHandler', deduplicateHook);
fastify.addHook('preHandler', clientHook);
fastify.addHook('preHandler', isBotHook);
@@ -24,7 +26,6 @@ const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
url: '/decrement',
handler: controller.decrementProfileProperty,
});
done();
};
export default eventRouter;