,
This commit is contained in:
@@ -17,22 +17,22 @@ const links = [
|
|||||||
"https://live.btcforplebs.com",
|
"https://live.btcforplebs.com",
|
||||||
"https://explorer.btcforplebs.com",
|
"https://explorer.btcforplebs.com",
|
||||||
"https://nsec.btcforplebs.com",
|
"https://nsec.btcforplebs.com",
|
||||||
"https://flotilla.btcforplebs.com"
|
"https://flotilla.btcforplebs.com",
|
||||||
"https://jumble.btcforplebs.com"
|
"https://jumble.btcforplebs.com"
|
||||||
];
|
];
|
||||||
|
|
||||||
// Optional: Only allow internal requests if you're not exposing this publicly
|
// Optional: Only allow internal requests if you're not exposing this publicly
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
const origin = req.headers.origin || 'unknown';
|
const origin = req.headers.origin || 'unknown';
|
||||||
console.log(`Request: ${req.method} ${req.url} | Origin: ${origin}`);
|
console.log(`Request: ${req.method} ${req.url} | Origin: ${origin}`);
|
||||||
res.header("Access-Control-Allow-Origin", "*");
|
res.header("Access-Control-Allow-Headers", "Content-Type");
|
||||||
res.header("Access-Control-Allow-Methods", "GET, OPTIONS");
|
res.header("Access-Control-Allow-Origin", "*");
|
||||||
res.header("Access-Control-Allow-Headers", "Content-Type");
|
res.header("Access-Control-Allow-Methods", "GET, OPTIONS");
|
||||||
|
|
||||||
if (req.method === 'OPTIONS') {
|
if (req.method === 'OPTIONS') {
|
||||||
return res.sendStatus(200);
|
return res.sendStatus(200);
|
||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/", (req, res) => {
|
app.get("/", (req, res) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user