trails/apps/journal/app/routes/api.health.ts
Ullrich Schäfer 0ff9052ae8
Add version (git SHA) to health endpoints
Returns SENTRY_RELEASE (set at build time) as the version field,
making it easy to verify which commit is deployed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 20:48:27 +01:00

13 lines
374 B
TypeScript

import { data } from "react-router";
import { withDb } from "@trails-cool/db";
const version = process.env.SENTRY_RELEASE ?? "dev";
export async function loader() {
try {
await withDb(async () => {});
return data({ status: "ok", version, db: "connected" });
} catch {
return data({ status: "degraded", version, db: "unreachable" }, { status: 503 });
}
}