solved MIME type warnings
This commit is contained in:
parent
93be3718c5
commit
84ca690684
1 changed files with 4 additions and 1 deletions
|
@ -90,6 +90,9 @@ var server = http.createServer(option, function(req, res){
|
||||||
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");
|
||||||
}
|
}
|
||||||
|
if(filename.endsWith('.js'))
|
||||||
|
res.writeHead(200, {'Content-Type': 'text/javascript'});
|
||||||
|
else
|
||||||
res.writeHead(200, {'Content-Type': 'text/html'});
|
res.writeHead(200, {'Content-Type': 'text/html'});
|
||||||
res.write(data);
|
res.write(data);
|
||||||
return res.end();
|
return res.end();
|
||||||
|
|
Loading…
Reference in a new issue