api entities
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user