Answer the question
In order to leave comments, you need to log in
Why don't styles work after running through Localhost?
There is a site layout with this structure:
But when I run through the node (server.js) Only html is loaded + The page cannot find directory files:
--------------------- -------------------------------------------------- -
server.js :
var app = require('express')(),
http = require('http').Server(app),
io = require('socket.io')(http);
app.get('/', function(req, res){
res.sendFile(__dirname + '/index.html');
});
io.on('connection', function(socket){
console.log('Someone connected!');
socket.on('chat message', function(msg){
io.emit('chat message', msg);
console.log('someone chated: ' + msg);
});
socket.on('disconnect', function(){
console.log('someone Disconnected');
});
});
http.listen(3000, function(){
console.log('Listening on port 3000')
});
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="styles/phone.css">
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