Added domain limit details to webpage

Signed-off-by: Marcus Noble <github@marcusnoble.co.uk>
This commit is contained in:
2025-08-23 09:00:37 +01:00
parent b5db132e16
commit 352ae3a840
2 changed files with 17 additions and 3 deletions

View File

@@ -79,11 +79,15 @@ http.createServer((req, response) => {
}).listen(PORT);
function loadWebpage(req, res) {
fs.readFile(__dirname + "/index.html")
fs.readFile(__dirname + "/index.html", { encoding: 'utf8' })
.then(contents => {
res.setHeader("Content-Type", "text/html");
res.writeHead(200);
res.end(contents);
res.end(
contents
.replaceAll('[[BLOCKLIST]]', JSON.stringify(blockList))
.replaceAll('[[ALLOWLIST]]', JSON.stringify(allowList))
);
})
.catch(err => {
res.writeHead(500);