From e56947fad409f3a61bbe7fdc06ff6b205e445d08 Mon Sep 17 00:00:00 2001 From: sgay Date: Mon, 12 Sep 2022 12:05:17 +0000 Subject: [PATCH] mis map dans static, corrig serveur static --- map.html => static/map.html | 0 traque.js | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename map.html => static/map.html (100%) diff --git a/map.html b/static/map.html similarity index 100% rename from map.html rename to static/map.html diff --git a/traque.js b/traque.js index a09b941..4e49b14 100644 --- a/traque.js +++ b/traque.js @@ -39,10 +39,11 @@ var server = http.createServer(option, function(req, res){ if(q.pathname.includes("..")) filename = "static/dotdot.html"; if(q.pathname == "/") - filename = "map.html"; + filename = "static/map.html"; fs.readFile(filename, function(err, data) { if (err) { - res.writeHead(404, {'Content-Type': 'text/html'}); + console.log("404: ", q.pathname, filename); + res.writeHead(404, {'Content-Type': 'text/html'}); return res.end("404 Not Found"); } res.writeHead(200, {'Content-Type': 'text/html'});