Files
enstrayedapi/routes/debug.js
2025-04-20 18:30:29 -07:00

19 lines
535 B
JavaScript

import { app, globalConfig } from "../index.js" // Get globals from index
import { checkToken } from "../liberals/auth.js"
import { logRequest } from "../liberals/logging.js"
app.get("/api/debugtokencheck", (rreq,rres) => {
checkToken(rreq.get("Authorization"),"etyd").then(authRes => {
if (authRes) {
rres.sendStatus(200)
} else {
rres.sendStatus(401)
}
})
})
app.get("/api/debugurl", (rreq,rres) => {
rres.send(`${rreq.protocol}://${rreq.get("Host")}`)
})
export { app }