@villedemontreal/correlation-id
Version:
Express middleware to set a correlation in Express. The correlation id will be consistent across async calls within the handling of a request.
27 lines • 792 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.constants = exports.Constants = void 0;
const app_root_path_1 = require("app-root-path");
const path = require("path");
/**
* Library constants
*/
class Constants {
constructor() {
// From the "dist/src/config" folder
this.libRoot = path.normalize(path.join(__dirname, '/../../..'));
this.appRoot = app_root_path_1.path;
}
/**
* Extra values that we can add to the original Express request.
*/
get requestExtraVariables() {
return {
cidReceivedInRequest: '_cidReceivedInRequest',
cidNew: '_cidNew',
};
}
}
exports.Constants = Constants;
exports.constants = new Constants();
//# sourceMappingURL=constants.js.map