Skip to content

Commit

Permalink
Refactor swagger documentation route to only be enabled in developmen…
Browse files Browse the repository at this point in the history
…t environment
  • Loading branch information
OomsOoms committed Sep 29, 2024
1 parent 7d06402 commit 55699bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/src/api/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ const sessionRoutes = require('./session.routes');
const authRoutes = require('./auth.routes');

module.exports = (app) => {
app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec));
if (process.env.NODE_ENV === 'development') {
app.use('/docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec));
}
app.use('/api/users', userRoutes);
app.use('/api/sessions', sessionRoutes);
app.use('/api/auth', authRoutes);
Expand Down

0 comments on commit 55699bb

Please sign in to comment.