From 2a9ee30759b1131e136a1def7d2758c0771a75c7 Mon Sep 17 00:00:00 2001 From: juancarmore Date: Wed, 8 Oct 2025 11:25:53 +0200 Subject: [PATCH] backend: serve internal API docs only in development mode --- backend/src/server.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/src/server.ts b/backend/src/server.ts index 72688e8..63249f0 100644 --- a/backend/src/server.ts +++ b/backend/src/server.ts @@ -58,9 +58,13 @@ const createApp = () => { app.use(`${INTERNAL_CONFIG.API_BASE_PATH_V1}/recordings`, /*mediaTypeValidatorMiddleware,*/ recordingRouter); // Internal API routes - app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/docs`, (_req: Request, res: Response) => - res.sendFile(internalApiHtmlFilePath) - ); + if (process.env.NODE_ENV === 'development') { + // Serve internal API docs only in development mode + app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/docs`, (_req: Request, res: Response) => + res.sendFile(internalApiHtmlFilePath) + ); + } + app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/auth`, authRouter); app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/users`, userRouter); app.use(`${INTERNAL_CONFIG.INTERNAL_API_BASE_PATH_V1}/rooms`, internalRoomRouter);