dino-express
Version:
DinO enabled REST framework based on express
24 lines • 838 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RequestScopedInjectable = void 0;
const tslib_1 = require("tslib");
const dino_core_1 = require("dino-core");
const express_http_context2_1 = tslib_1.__importDefault(require("express-http-context2"));
class RequestScopedInjectable extends dino_core_1.Injectable {
/**
* Allows to access the current http context
* @returns the http context
*/
getHttpContext() {
const httpContext = express_http_context2_1.default.get('httpContext');
if (httpContext === undefined) {
return {
headers: {},
query: {}
};
}
return httpContext;
}
}
exports.RequestScopedInjectable = RequestScopedInjectable;
//# sourceMappingURL=RequestScopedInjectable.js.map