more testing with ip

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-02-12 11:27:53 +01:00
parent 500518b6e8
commit e5b5ac32fa
6 changed files with 19 additions and 23 deletions

View File

@@ -2,7 +2,6 @@ import cors from '@fastify/cors';
import Fastify from 'fastify';
import { FastifySSEPlugin } from 'fastify-sse-v2';
import pino from 'pino';
import { getClientIp } from 'request-ip';
import { redisPub } from '@mixan/redis';
@@ -30,15 +29,6 @@ const startServer = async () => {
origin: '*',
});
fastify.addHook('preHandler', (req, reply, done) => {
const ip = getClientIp(req)!;
console.log('---------------');
console.log('ip', ip);
console.log('heacders', req.headers);
console.log('---------------');
done();
});
fastify.register(FastifySSEPlugin);
fastify.decorateRequest('projectId', '');
fastify.register(eventRouter, { prefix: '/event' });