UNPKG

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

26 lines 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Openapi = void 0; const Log_1 = require("../../utils/Log"); const Openapi = (path, options) => { const globalOpenapiOptions = { documentationPath: path || "/api-docs", openapi: options?.openapi || "3.0.3", info: { description: options?.info?.description || "My API description", version: options?.info?.version || "1.0.0", title: options?.info?.title || "Cats API", }, host: options?.host || "localhost:8080", basePath: options?.basePath || "/", schemes: options?.schemes || ["http", "https"], definitions: options?.definitions || {}, paths: options?.paths || {}, }; return (constructor) => { (0, Log_1.Log)(`Openapi is registered at ${path}`); Reflect.defineMetadata("openapi-options", globalOpenapiOptions, constructor); }; }; exports.Openapi = Openapi; //# sourceMappingURL=Openapi.js.map