My folders:
server.js
index.html
-public
--css
--ses.scss
--style.css
Server js:
var express = require('express');
var path = require('path');
var publicPath = path.resolve(path.join(__dirname, 'public'));
var app = express();
var http = require('http').Server(app);
var fs = require('fs');
app.use(express.static(path.join(__dirname, 'public')));
app.get('/', function (req, res) {
res.sendfile('./index.html');
});
http.listen(3000, function () {
console.log('listening on *:3000');
});
Index.html:
<link rel="stylesheet" type="text/css" href="/public/css/ses.scss">
<link rel="stylesheet" type="text/css" href="/public/css/style.css">
CSS works when I open index.html with google chrome without server.When I use node.js CSS isn't loading.