chore(api): clean up index file

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-10-24 19:30:15 +02:00
parent 035d405a04
commit 949278ff1c
5 changed files with 189 additions and 140 deletions

View File

@@ -0,0 +1,16 @@
import type {
FastifyReply,
FastifyRequest,
HookHandlerDoneFunction,
} from 'fastify';
export function requestIdHook(
request: FastifyRequest,
reply: FastifyReply,
done: HookHandlerDoneFunction,
) {
if (!request.headers['request-id']) {
request.headers['request-id'] = request.id;
}
done();
}