Skip to content

Commit

Permalink
Enable swagger with env flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bcomnes committed Feb 5, 2023
1 parent 8817f4c commit 4ab98d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions plugins/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ export const schema = {
YT_DLP_API_URL: {
type: 'string',
default: 'http://user:pass@127.0.0.1:5000'
},
SWAGGER: {
type: 'boolean',
default: true
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/swagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default fp(async function (fastify, opts) {
}
})

if (fastify.config.ENV !== 'production') {
if (fastify.config.SWAGGER) {
fastify.register(import('@fastify/swagger-ui'), {
routePrefix: '/openapi'
})
Expand Down

0 comments on commit 4ab98d5

Please sign in to comment.