aboutsummaryrefslogtreecommitdiff
path: root/174bg/database/volumes/pocketbase/pb_hooks/stats.pb.js
diff options
context:
space:
mode:
authorAlex Pooley (@zuedev) <zuedev@gmail.com>2026-07-24 20:10:53 +0100
committerAlex Pooley (@zuedev) <zuedev@gmail.com>2026-07-24 20:10:53 +0100
commit7dfd7b404cdcf0db8e44a8b357cd108e10a725e1 (patch)
treee92fbf31cde6107e818777c8488fa61a67f3e9ff /174bg/database/volumes/pocketbase/pb_hooks/stats.pb.js
parenteb719a5416391521d536980e974f97b7ac8b78e3 (diff)
downloadunnamed-group-7dfd7b404cdcf0db8e44a8b357cd108e10a725e1.tar
unnamed-group-7dfd7b404cdcf0db8e44a8b357cd108e10a725e1.tar.gz
unnamed-group-7dfd7b404cdcf0db8e44a8b357cd108e10a725e1.tar.bz2
unnamed-group-7dfd7b404cdcf0db8e44a8b357cd108e10a725e1.tar.xz
unnamed-group-7dfd7b404cdcf0db8e44a8b357cd108e10a725e1.zip
better arch of stats
Diffstat (limited to '174bg/database/volumes/pocketbase/pb_hooks/stats.pb.js')
-rw-r--r--174bg/database/volumes/pocketbase/pb_hooks/stats.pb.js18
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