File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,10 @@ import fp from 'fastify-plugin'
2
2
import swaggerUI , { type FastifySwaggerUiOptions } from '@fastify/swagger-ui'
3
3
4
4
export default fp < FastifySwaggerUiOptions > ( async ( fastify ) => {
5
- await fastify . register ( swaggerUI , {
6
- routePrefix : '/docs'
7
- } )
5
+ console . log ( process . env . SWAGGER_ENABLED === '1' , process . env . SWAGGER_ROUTE )
6
+ if ( process . env . SWAGGER_ENABLED === '1' ) {
7
+ await fastify . register ( swaggerUI , {
8
+ routePrefix : process . env . SWAGGER_ROUTE
9
+ } )
10
+ }
8
11
} )
Original file line number Diff line number Diff line change @@ -36,5 +36,8 @@ export const SEnv = Type.Object({
36
36
37
37
ADMIN_NAME : Type . String ( ) ,
38
38
ADMIN_EMAIL : Type . String ( ) ,
39
- ADMIN_PASSWORD : Type . String ( )
39
+ ADMIN_PASSWORD : Type . String ( ) ,
40
+
41
+ SWAGGER_ENABLED : Type . String ( ) ,
42
+ SWAGGER_ROUTE : Type . String ( )
40
43
} )
You can’t perform that action at this time.
0 commit comments