UNPKG

inversify-express-utils

Version:

Some utilities for the development of express applications with Inversify

22 lines 946 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CreatedNegotiatedContentResult = void 0; const http_status_codes_1 = require("http-status-codes"); const stringContent_1 = require("../content/stringContent"); const httpResponseMessage_1 = require("../httpResponseMessage"); class CreatedNegotiatedContentResult { location; content; constructor(location, content) { this.location = location; this.content = content; } async executeAsync() { const response = new httpResponseMessage_1.HttpResponseMessage(http_status_codes_1.StatusCodes.CREATED); response.content = new stringContent_1.StringContent(JSON.stringify(this.content)); response.headers['location'] = this.location.toString(); return response; } } exports.CreatedNegotiatedContentResult = CreatedNegotiatedContentResult; //# sourceMappingURL=CreatedNegotiatedContentResult.js.map