@vtex/diagnostics-nodejs
Version:
Diagnostics library for Node.js applications
18 lines • 583 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.KoaMiddlewares = void 0;
const core_1 = require("./core");
function ContextPropagationMiddleware() {
return async function koaContextMiddleware(ctx, next) {
await new Promise((resolve, reject) => {
const downstreamFn = () => {
next().then(resolve).catch(reject);
};
(0, core_1.ensureContextPropagation)(downstreamFn);
});
};
}
exports.KoaMiddlewares = {
ContextPropagationMiddleware,
};
//# sourceMappingURL=koa.js.map