intials app
This commit is contained in:
1
app/src/internal/ocp/printers/printers.ts
Normal file
1
app/src/internal/ocp/printers/printers.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const printers = () => {};
|
||||
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" });
|
||||
});
|
||||
}
|
||||
10
app/src/internal/routerHandler/routes/healthRoutes.ts
Normal file
10
app/src/internal/routerHandler/routes/healthRoutes.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { Router } from "express";
|
||||
|
||||
const router = Router();
|
||||
|
||||
// GET /health
|
||||
router.get("/", (req, res) => {
|
||||
res.json({ status: "ok", uptime: process.uptime() });
|
||||
});
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user