Reputation: 1061
I've got this code:
app.use(express.static(__dirname + '/assets'));
app.get('/', function(req, res){
res.sendFile(path.join( __dirname, 'assets', 'index.html' ));
});
But am still getting these errors:
Any idea what the heck I'm doing wrong? (of course the files exist in the directory as shown)
Thanks in advance!
Upvotes: 0
Views: 1878
Reputation: 203304
If you have a file called ./assets/css/bootstrap.css
and you configure express.static
so that ./assets/
is the root directory, the URL should be /css/bootstrap.css
.
Upvotes: 1