Files
stats/apps/api/src/routes/event.router.ts
2025-02-28 10:03:28 +01:00

19 lines
496 B
TypeScript

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