Here are my folders:
server.js
index.html
-public
--css
--ses.scss
--style.css
This is the Server js code:
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');
});
Within the Index.html file:
<link rel="stylesheet" type="text/css" href="/public/css/ses.scss">
<link rel="stylesheet" type="text/css" href="/public/css/style.css">
The CSS files work properly when I directly open the index.html file with Google Chrome, but when I run the page using node.js, the CSS doesn't load properly.