module.exports = app => { const swaggerJsdoc = require('swagger-jsdoc'), swaggerUi = require('swagger-ui-express'), options = { swaggerOptions: { withCredentials: false }, swaggerDefinition: { restapi: '3.1.0', info: { title: 'Fediblock Instance API', version: '1.0.0', description: '#Fediblock Instance REST API', }, servers: [ { url: 'http://localhost:3000', }, ], }, apis: ['**/apiswagger.js'], }, specs = swaggerJsdoc(options) app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(specs, { explorer: false })) }