diff options
| author | Adam Soltys <[email protected]> | 2026-02-06 16:55:45 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-02-06 16:55:45 +0000 |
| commit | 9089698e8df9d0c09c165c45eb6b05335a818699 (patch) | |
| tree | 592be0e8964857d7be5ca9baacb6143b29903b27 /routes/info.ts | |
| parent | 0ad6c9ec8a4f91e1d45af4a76330cc3ddcf177a2 (diff) | |
| download | coinos-server-9089698e8df9d0c09c165c45eb6b05335a818699.tar.gz coinos-server-9089698e8df9d0c09c165c45eb6b05335a818699.zip | |
health check
Diffstat (limited to 'routes/info.ts')
| -rw-r--r-- | routes/info.ts | 7 |
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; |
