create-glxcier-app
Version:
Project setup wizard for Glxcier template
31 lines (29 loc) • 888 B
text/typescript
import { Context } from "hono";
export class HealthController {
static checkHealth(c : Context) {
try {
//TODO: add health check logic
return c.json({
status: "ok",
timestamp: new Date().toISOString(),
service: "your-service-name",
version: "1.0.0",
checks: {
database: "connected",
cache: "connected",
},
});
} catch (error) {
const errorMessage =
error instanceof Error ? error.message : "Service unhealthy";
return c.json(
{
status: "error",
message: errorMessage,
timestamp: new Date().toISOString(),
},
503
);
}
}
}