UNPKG

@thisisagile/easy-express

Version:

Straightforward library for building domain-driven microservice architectures

10 lines 342 B
// src/express/CorrelationHandler.ts import { ctx, HttpHeader, toUuid } from "@thisisagile/easy"; var correlation = (req, res, next) => { res.setHeader(HttpHeader.Correlation, ctx.request.correlationId = req?.header(HttpHeader.Correlation) ?? toUuid()); next(); }; export { correlation }; //# sourceMappingURL=CorrelationHandler.mjs.map