I have an application which serves html and looks like this.
// ...
var staticPath = config.development.staticFiles;
app.get('/category/:catName', function(req, res) {
res.sendFile(path.join(__dirname, staticPath + "shop-grid.html"));
})
app.get('/', function(req, res) {
res.sendFile(path.join(__dirname, staticPath + "index.html"));
})
// ...
In each html, the css are linked like this .
<link rel="stylesheet" href="css/style.css" type="text/css">
The index.html works fine, but the "shop-grid.html" does not load with css, because it tried to load css at "localhost:8080/category/css/style.css" instead of "localhost:8080/css/style.css", which works for the first html.
What did i do wrong here ?