api entities

This commit is contained in:
2022-10-11 12:18:12 +02:00
parent 63478aa887
commit 8866784d49
19 changed files with 106 additions and 21 deletions

View File

@ -1,6 +1,10 @@
import { RequestHandler } from 'express';
import { Request, RequestHandler } from 'express';
import { randomUUID } from 'crypto';
export function getId(req: Request): string {
return req.get('request-id') || 'unknown';
}
export function BeforeEach(): RequestHandler {
return (req, res, next) => {
req.headers['request-id'] = randomUUID();