replace logtail with baselime

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-04-17 22:33:58 +02:00
committed by Carl-Gerhard Lindesvärd
parent dd53a5757a
commit 971e645bdd
6 changed files with 42 additions and 102 deletions

View File

@@ -1,13 +1,14 @@
import { isBot } from '@/bots';
import * as controller from '@/controllers/profile.controller';
import { validateSdkRequest } from '@/utils/auth';
import { logger } from '@/utils/logger';
import type { FastifyPluginCallback } from 'fastify';
const eventRouter: FastifyPluginCallback = (fastify, opts, done) => {
fastify.addHook('preHandler', async (req, reply) => {
try {
const projectId = await validateSdkRequest(req.headers).catch(
req.log.error
logger.error
);
if (!projectId) {
return reply.status(401).send();