intials app
This commit is contained in:
15
app/src/internal/routerHandler/routeHandler.ts
Normal file
15
app/src/internal/routerHandler/routeHandler.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { Express, Request, Response } from "express";
|
||||
|
||||
import healthRoutes from './routes/healthRoutes.js'
|
||||
|
||||
|
||||
export const setupRoutes = (app: Express, basePath: string) => {
|
||||
// Root / health check
|
||||
app.use(basePath + "/health", healthRoutes);
|
||||
|
||||
|
||||
// Fallback 404 handler
|
||||
app.use((req: Request, res: Response) => {
|
||||
res.status(404).json({ error: "Not Found" });
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user