reest
Version:
A library inspired by NestJS's elegance, specifically designed for efficient serverless API development on AWS Lambda. It streamlines the creation of microservices with automated Swagger documentation and enhanced decorator-based middleware support, makin
21 lines • 850 B
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.initializeOpenapi = void 0;
const swagger_ui_express_1 = __importDefault(require("swagger-ui-express"));
const initializeOpenapi = (app, options) => {
const openapiPath = options.documentationPath;
(async () => {
app.use(openapiPath, swagger_ui_express_1.default.serveWithOptions({
redirect: false,
}));
app.get(openapiPath, swagger_ui_express_1.default.setup(options));
app.get(openapiPath + "/swagger.json", (req, res) => {
res.json(options);
});
})();
};
exports.initializeOpenapi = initializeOpenapi;
//# sourceMappingURL=initializeOpenapi.js.map
;