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!
如果您有一个名为./assets/css/bootstrap.css
的文件,并且配置了express.static
以使./assets/
为根目录,则URL应为/css/bootstrap.css
。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.