Files
stats/apps/api/src/routes/event.router.ts
Carl-Gerhard Lindesvärd 1285ad85a2 fix: performance related fixes
2025-11-15 20:09:04 +01:00

21 lines
603 B
TypeScript

import * as controller from '@/controllers/event.controller';
import type { FastifyPluginCallback } from 'fastify';
import { clientHook } from '@/hooks/client.hook';
import { duplicateHook } from '@/hooks/duplicate.hook';
import { isBotHook } from '@/hooks/is-bot.hook';
const eventRouter: FastifyPluginCallback = async (fastify) => {
fastify.addHook('preValidation', duplicateHook);
fastify.addHook('preHandler', clientHook);
fastify.addHook('preHandler', isBotHook);
fastify.route({
method: 'POST',
url: '/',
handler: controller.postEvent,
});
};
export default eventRouter;