8 lines
208 B
TypeScript
8 lines
208 B
TypeScript
import type { RequestHandler } from "express";
|
|
import crypto from "node:crypto";
|
|
|
|
export const requestIdMiddleware: RequestHandler = (req, _res, next) => {
|
|
req.requestId = crypto.randomUUID();
|
|
next();
|
|
};
|