azurite
Version:
An open source Azure Storage API compatible server
47 lines • 1.04 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class ExpressRequestAdapter {
constructor(req) {
this.req = req;
}
getMethod() {
return this.req.method.toUpperCase();
}
getUrl() {
return this.req.url;
}
getEndpoint() {
return `${this.req.protocol}://${this.getHeader("host") ||
this.req.hostname}`;
}
getPath() {
return this.req.path;
}
getBodyStream() {
return this.req;
}
getBody() {
return this.req.body;
}
setBody(body) {
this.req.body = body;
return this;
}
getHeader(field) {
return this.req.header(field);
}
getHeaders() {
return this.req.headers;
}
getRawHeaders() {
return this.req.rawHeaders;
}
getQuery(key) {
return this.req.query[key];
}
getProtocol() {
return this.req.protocol;
}
}
exports.default = ExpressRequestAdapter;
//# sourceMappingURL=ExpressRequestAdapter.js.map