api/index.js
Rama main · réplica de lectura del repositorio original.
const swaggerJsDoc = require("swagger-jsdoc");
const swaggerUi = require("swagger-ui-express");
const swaggerOptions = require("./swaggerOptions")
const swaggerDocs = swaggerJsDoc(swaggerOptions);
const useSwagger = (app, swaggerPath = '/api-docs') => {
app.use(swaggerPath, swaggerUi.serve, swaggerUi.setup(swaggerDocs))
}
module.exports = useSwagger