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

TSJR-12 prepare skills API for action -> dev #30

Merged
merged 8 commits into from
Aug 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
disable serving swagger docs
  • Loading branch information
kkartunov committed Aug 31, 2023
commit 47225ccae11ce71ed0de6f4d8c9cc8acb3fea556
11 changes: 4 additions & 7 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ const cross = require('cors')
const bodyParser = require('body-parser')
const _ = require('lodash')
const http = require('http')
const swaggerUi = require('swagger-ui-express')
const jsyaml = require('js-yaml')
const fs = require('fs')
const path = require('path')
const logger = require('./src/common/logger')
const errorMiddleware = require('./src/common/error.middleware')
const routes = require('./src/route')
Expand Down Expand Up @@ -63,10 +59,11 @@ _.each(routes, (verbs, url) => {
})
})
app.use('/', apiRouter)
const spec = fs.readFileSync(path.join(__dirname, 'docs/swagger.yaml'), 'utf8')
const swaggerDoc = jsyaml.safeLoad(spec)
// disable swagger docs as we do not want use them served by this service
// const spec = fs.readFileSync(path.join(__dirname, 'docs/swagger.yaml'), 'utf8')
// const swaggerDoc = jsyaml.safeLoad(spec)

app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDoc))
// app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerDoc))

app.use(errorMiddleware())
app.use('*', (req, res) => {
Expand Down