Answer the question
In order to leave comments, you need to log in
How to connect a script to a page?
There is a server which gives page on url. How to connect .js .css files to this page without express.js?
http.createServer(function(req,res){
switch(req.url){
case '/':
fs.readFile('index.html',function(err,data){
if (err) throw err;
res.writeHead(200,{'Content-Type': 'text/html'});
res.end(data);
});
break;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question