generated from Dicken/dickendock
Erstes lauffähiges Grundgerüst: Monorepo, Fastify-API, React-Startseite, Docker
This commit is contained in:
15
apps/backend/src/routes/health.ts
Normal file
15
apps/backend/src/routes/health.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import type { FastifyInstance } from "fastify";
|
||||
import type { HealthStatus } from "@launchpad/shared";
|
||||
|
||||
const startedAt = Date.now();
|
||||
|
||||
export async function healthRoutes(app: FastifyInstance): Promise<void> {
|
||||
app.get("/api/health", async (): Promise<HealthStatus> => {
|
||||
return {
|
||||
status: "ok",
|
||||
timestamp: new Date().toISOString(),
|
||||
uptimeSeconds: Math.round((Date.now() - startedAt) / 1000),
|
||||
version: "0.1.0",
|
||||
};
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user