mis map dans static, corrig serveur static

This commit is contained in:
sgay 2022-09-12 12:05:17 +00:00
parent 445be5f7ff
commit e56947fad4
2 changed files with 3 additions and 2 deletions

View file

@ -39,9 +39,10 @@ var server = http.createServer(option, function(req, res){
if(q.pathname.includes("..")) if(q.pathname.includes(".."))
filename = "static/dotdot.html"; filename = "static/dotdot.html";
if(q.pathname == "/") if(q.pathname == "/")
filename = "map.html"; filename = "static/map.html";
fs.readFile(filename, function(err, data) { fs.readFile(filename, function(err, data) {
if (err) { if (err) {
console.log("404: ", q.pathname, filename);
res.writeHead(404, {'Content-Type': 'text/html'}); res.writeHead(404, {'Content-Type': 'text/html'});
return res.end("404 Not Found"); return res.end("404 Not Found");
} }