rework routes/ip.js

This commit is contained in:
Enstrayed
2024-05-02 17:44:17 -07:00
parent 544f1fb017
commit 39c6a7b22c

View File

@@ -2,12 +2,16 @@ const { app } = require("../index.js")
app.get("/ip", (rreq,rres) => { app.get("/ip", (rreq,rres) => {
let jsonResponse = { let jsonResponse = {
"IP": rreq.get("cf-connecting-ip") || "you_did", "IP": rreq.get("cf-connecting-ip") || rreq.ip,
"Country": rreq.get("cf-ipcountry") || "not_connect", "Country": rreq.get("cf-ipcountry") || "not_cloudflare",
"CfRay": rreq.get("cf-ray") || "via_cloudflare" "CfRay": rreq.get("cf-ray") || "not_cloudflare"
} }
rres.send(jsonResponse); rres.send(jsonResponse)
})
app.get("/headers", (rreq,rres) => {
rres.send(rreq.headers)
}) })
module.exports = {app} module.exports = {app}