generated from Dicken/dickendock
16 lines
452 B
TypeScript
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",
|
|
};
|
|
});
|
|
}
|