v0.2.3 Core tier 10/5/5 split + dynamic health version

This commit is contained in:
local
2026-05-11 21:53:50 -05:00
parent 07fe14010c
commit 6797aae404
8 changed files with 138 additions and 15 deletions
+20 -1
View File
@@ -3,8 +3,27 @@
// /api/relay/status can verify the relay is reachable.
import express from "express";
import { readFileSync } from "fs";
import path from "path";
import { fileURLToPath } from "url";
import { getConfigSnapshot } from "../config.js";
// Pull the version off server/package.json once at module load — the
// build pipeline bumps that file in lockstep with each StartOS version
// bump, so the health endpoint always reports a meaningful number.
const __dirname = path.dirname(fileURLToPath(import.meta.url));
let VERSION = "unknown";
try {
const pkg = JSON.parse(
readFileSync(path.join(__dirname, "..", "package.json"), "utf8")
);
VERSION = pkg.version || "unknown";
} catch {
// Read failure is non-fatal — health still works, just reports
// "unknown". Build pipeline shouldn't ever ship a missing
// package.json so this branch is defensive only.
}
export function healthRouter() {
const router = express.Router();
@@ -13,7 +32,7 @@ export function healthRouter() {
res.json({
ok: true,
service: "recap-relay",
version: "0.1.0",
version: VERSION,
backends: {
gemini: !!cfg.relay_gemini_api_key,
parakeet: !!cfg.relay_parakeet_base_url,