Skip to content

Commit 0e0c31a

Browse files
committed
stats routes for healthcheck
1 parent e00470d commit 0e0c31a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

apps/api-v2/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import jwt from "jsonwebtoken";
1111
import { buildTasksRouter } from "./routers/tasks";
1212
import { loggerOptions } from "./logging";
1313
import responseTime from "response-time";
14+
import buildStatsRouter from "./routers/stats";
1415

1516
export const createApp = () => {
1617
const app = express();
@@ -55,6 +56,7 @@ export const createApp = () => {
5556
// use auth router
5657
app.use(buildAuthRouter());
5758
app.use(buildTasksRouter());
59+
app.use(buildStatsRouter());
5860

5961
return { app };
6062
};

apps/api-v2/src/routers/stats.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import express from "express";
2+
3+
export default function buildStatsRouter() {
4+
const router = express.Router();
5+
6+
router.get("/", async (_, res) => {
7+
return res.send({
8+
up: true,
9+
});
10+
});
11+
return router;
12+
}

0 commit comments

Comments
 (0)