add support to disable the key
All checks were successful
Docker build image / build (push) Successful in 33s

This commit is contained in:
Fijxu 2024-12-21 17:07:50 -03:00
parent a015576902
commit c1417a6913
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -6,6 +6,7 @@ const http = require('http');
const port = env.PORT || "3000"
const address = env.ADDRESS || "0.0.0.0"
const key = env.KEY
const nokey = env.USE_KEY || "false"
let tokens = {};
@ -49,6 +50,12 @@ const server = http.Server(async (req, res) => {
visitorData: tokens.visitorData,
};
if (nokey) {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.write(JSON.stringify(json));
return res.end();
}
if (host === `127.0.0.1:${port}` || host === `localhost:${port}`) {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.write(JSON.stringify(json));