aboutsummaryrefslogtreecommitdiffstats
path: root/routes/info.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-02-06 16:55:45 +0000
committerAdam Soltys <[email protected]>2026-02-06 16:55:45 +0000
commit9089698e8df9d0c09c165c45eb6b05335a818699 (patch)
tree592be0e8964857d7be5ca9baacb6143b29903b27 /routes/info.ts
parent0ad6c9ec8a4f91e1d45af4a76330cc3ddcf177a2 (diff)
downloadcoinos-server-9089698e8df9d0c09c165c45eb6b05335a818699.tar.gz
coinos-server-9089698e8df9d0c09c165c45eb6b05335a818699.zip
health check
Diffstat (limited to 'routes/info.ts')
-rw-r--r--routes/info.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/routes/info.ts b/routes/info.ts
index c6d03e4d..a0ac7693 100644
--- a/routes/info.ts
+++ b/routes/info.ts
@@ -1,9 +1,16 @@
import { archive } from "$lib/db";
import { db, g } from "$lib/db";
+import { getHealthStatus } from "$lib/health";
import ln from "$lib/ln";
import { getDecodedToken } from "@cashu/cashu-ts";
export default {
+ async health(_, res) {
+ const status = getHealthStatus();
+ const httpStatus = status.healthy ? 200 : 503;
+ res.status(httpStatus).send(status);
+ },
+
async balances(_, res) {
let total = 0;