inversify-express-utils
Version:
Some utilities for the development of express applications with Inversify
25 lines • 997 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OkNegotiatedContentResult = void 0;
const http_status_codes_1 = require("http-status-codes");
const jsonContent_1 = require("../content/jsonContent");
const stringContent_1 = require("../content/stringContent");
const httpResponseMessage_1 = require("../httpResponseMessage");
class OkNegotiatedContentResult {
content;
constructor(content) {
this.content = content;
}
async executeAsync() {
const response = new httpResponseMessage_1.HttpResponseMessage(http_status_codes_1.StatusCodes.OK);
if (typeof this.content === 'string') {
response.content = new stringContent_1.StringContent(this.content);
}
else {
response.content = new jsonContent_1.JsonContent(this.content);
}
return response;
}
}
exports.OkNegotiatedContentResult = OkNegotiatedContentResult;
//# sourceMappingURL=OkNegotiatedContentResult.js.map