diff --git a/server/src/app.ts b/server/src/app.ts index a73d344..e145514 100644 --- a/server/src/app.ts +++ b/server/src/app.ts @@ -27,22 +27,21 @@ if (ENV.NODE_ENV === "dev") { app.use(apiRequestLogger); // Static files config with dynamic base path -const basePath = ENV.BASE_PATH || "/"; -app.use(basePath, express.static(path)); +app.use(ENV.BASE_PATH, express.static(path)); app.use(bodyParser.json()); // API routes -app.use(basePath, authorizationRoutes); -app.use(basePath, routes); +app.use(authorizationRoutes); +app.use(routes); // Static files route with dynamic base path -app.get(basePath + "/", (req: Request, res: Response) => { +app.get(ENV.BASE_PATH + "/", (req: Request, res: Response) => { console.log("Serving main index at:", mainIndexPath); res.sendFile(mainIndexPath); }); // Catch-all route to handle all other requests -app.get(basePath + "/*", (req: Request, res: Response) => { +app.get(ENV.BASE_PATH + "/*", (req: Request, res: Response) => { console.log("Catch-all route, serving main index at:", mainIndexPath); res.sendFile(mainIndexPath); });