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,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'});