You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
615 B
26 lines
615 B
3 years ago
|
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;
|