Files
LaunchPad/apps/backend/src/routes/health.ts

16 lines
452 B
TypeScript

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",
};
});
}