fediblock-instance/lib/swagger.js

26 lines
836 B
JavaScript
Raw Permalink Normal View History

2024-09-15 17:44:53 +00:00
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 }))
}