favicon & MIME type

This commit is contained in:
catvayor 2023-09-06 18:22:20 +02:00
parent ecdcd7e545
commit f231daf4e9
2 changed files with 4 additions and 0 deletions

BIN
static/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -99,6 +99,10 @@ var server = http.createServer(option, function(req, res){
}
if(filename.endsWith('.js'))
res.writeHead(200, {'Content-Type': 'text/javascript'});
else if(filename.endsWith('.png'))
res.writeHead(200, {'Content-Type': 'image/png'});
else if(filename.endsWith('.ico'))
res.writeHead(200, {'Content-Type': 'image/ico'});
else
res.writeHead(200, {'Content-Type': 'text/html'});
res.write(data);