routing-controllers
Version:
Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
22 lines • 831 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.JsonController = JsonController;
const index_1 = require("../index");
/**
* Defines a class as a JSON controller. If JSON controller is used, then all controller actions will return
* a serialized json data, and its response content-type always will be application/json.
*
* @param baseRoute Extra path you can apply as a base route to all controller actions
* @param options Extra options that apply to all controller actions
*/
function JsonController(baseRoute, options) {
return function (object) {
(0, index_1.getMetadataArgsStorage)().controllers.push({
type: 'json',
target: object,
route: baseRoute,
options,
});
};
}
//# sourceMappingURL=JsonController.js.map
;