add usage logging for premium services

This commit is contained in:
Enstrayed
2023-11-15 11:44:47 -08:00
parent d0fbff553f
commit 867884a4d2
3 changed files with 6 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ app.post("/cider", (rreq,rres) => { // POST stop listening on cider target
fetch(`http://${globalConfig.cider.targetHost}:${globalConfig.cider.targetPort}/stop`).then(fres => { // send GET /stop to cider target
if (fres.status == 204) {
console.log(`${rreq.get("cf-connecting-ip")} POST /cider returned 200 KEY:${rreq.get("Authorization")}`)
rres.sendStatus(200) // if that works then 200
} else {
rres.sendStatus(500) // otherwise lol