Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 47225cc

Browse files
committed
disable serving swagger docs
1 parent c5300ca commit 47225cc

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

app.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ const cross = require('cors')
99
const bodyParser = require('body-parser')
1010
const _ = require('lodash')
1111
const http = require('http')
12-
const swaggerUi = require('swagger-ui-express')
13-
const jsyaml = require('js-yaml')
14-
const fs = require('fs')
15-
const path = require('path')
1612
const logger = require('./src/common/logger')
1713
const errorMiddleware = require('./src/common/error.middleware')
1814
const routes = require('./src/route')
@@ -63,10 +59,11 @@ _.each(routes, (verbs, url) => {
6359
})
6460
})
6561
app.use('/', apiRouter)
66-
const spec = fs.readFileSync(path.join(__dirname, 'docs/swagger.yaml'), 'utf8')
67-
const swaggerDoc = jsyaml.safeLoad(spec)
62+
// disable swagger docs as we do not want use them served by this service
63+
// const spec = fs.readFileSync(path.join(__dirname, 'docs/swagger.yaml'), 'utf8')
64+
// const swaggerDoc = jsyaml.safeLoad(spec)
6865

69-
app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDoc))
66+
// app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDoc))
7067

7168
app.use(errorMiddleware())
7269
app.use('*', (req, res) => {

0 commit comments

Comments
 (0)