const router = require('express').Router(); const swaggerUi = require('swagger-ui-express'); const swaggerJsDoc = require('swagger-jsdoc'); const options = { definition: { openapi: "3.0.0", info: { title: "", version: "", description: "", }, servers: [ { url: `http://localhost:${process.env.PORT}` } ] }, apis: ["./router/*.js"] } const specs = swaggerJsDoc(options); router.use('/api-docs', swaggerUi.serve); router.get('/api-docs', swaggerUi.setup(specs)); module.exports = router;