diff options
Diffstat (limited to '174bg/database/volumes/pocketbase/pb_hooks/stats.pb.js')
| -rw-r--r-- | 174bg/database/volumes/pocketbase/pb_hooks/stats.pb.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/174bg/database/volumes/pocketbase/pb_hooks/stats.pb.js b/174bg/database/volumes/pocketbase/pb_hooks/stats.pb.js index e2b6ab3..3c9617b 100644 --- a/174bg/database/volumes/pocketbase/pb_hooks/stats.pb.js +++ b/174bg/database/volumes/pocketbase/pb_hooks/stats.pb.js @@ -1,6 +1,6 @@ routerAdd("get", "/stats", (e) => { - const heartbeat = $http.send({ - url: "https://db.174bg.net/api/heartbeat", + const stats = $http.send({ + url: "https://db.174bg.net/api/stats", headers: { "content-type": "application/json" } }) @@ -8,7 +8,17 @@ routerAdd("get", "/stats", (e) => { `${__hooks}/views/_layout.html`, `${__hooks}/views/stats.html`, ).render({ - "timeDifference": heartbeat.json.timeDifference, - "withinThreshold": heartbeat.json.withinThreshold, + stats: stats.json, })) +}) + +routerAdd("get", "/api/stats", (e) => { + const heartbeat = $http.send({ + url: "https://db.174bg.net/api/heartbeat", + headers: { "content-type": "application/json" } + }) + + return e.json(200, { + heartbeat: heartbeat.json, + }) })
\ No newline at end of file |
