fediblock-instance/lib/swagger.js
ale e0fae7a6b4
All checks were successful
continuous-integration/drone/tag Build is passing
initial commit
2024-09-15 19:44:53 +02:00

26 lines
836 B
JavaScript

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 }))
}