fix: respect debug flag in .env for swagger endpoint generation
All checks were successful
Build and push Docker image / build (push) Successful in 22s
All checks were successful
Build and push Docker image / build (push) Successful in 22s
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import * as express from 'express';
|
||||
import router from './routes';
|
||||
import * as dotenv from "dotenv";
|
||||
dotenv.config({ quiet: true });
|
||||
|
||||
const app = express();
|
||||
|
||||
@@ -20,6 +22,8 @@ const swaggerSpec = swaggerJsdoc(swaggerJsdocOpts);
|
||||
|
||||
app.use(express.json());
|
||||
app.use(router);
|
||||
app.use('/swagger', swaggerUi.serve, swaggerUi.setup(swaggerSpec));
|
||||
if (process.env.DEBUG === "true") {
|
||||
app.use('/swagger', swaggerUi.serve, swaggerUi.setup(swaggerSpec));
|
||||
}
|
||||
app.listen(6567, () => console.log('(HTTP Server) Listening on port 6567.'));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user