What should be the Content-Type in writeHead method of response object?
text/plain or application/javascript ?
index.html has index.js too and Node.js http server will send both file to the client(.html as well as .js).
I am getting following error in chrome
Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:8111/index.js"
Node.js
var httpServer = http.createServer(function(request,response){
fs.readFile(__dirname + '/index.html', function(error,data){
response.writeHead(200);
response.end(data);
});
});
httpServer.listen(8111);
index.html has:
<script src="index.js"></script>