Reputation: 201
When I try to use fontawesome locally I am always getting 404 error when the browser tries to load the fonts. I'm pretty sure I have set the path correctly.
I have set the static paths in app.js as follows.
app.use(express.static(__dirname + '/Content'));
app.use(express.static(__dirname + '/webfonts'));
Upvotes: 0
Views: 387
Reputation: 14589
You are referencing webfonts at the /webfonts
endpoint, but when you do not provide a path as the first parameter, it will be hosted at root. So, either reference the webfonts without the /webfonts
prefix, or try giving them an endpoint as the first parameter:
app.use('/Content', express.static(__dirname + '/Content'));
app.use('/webfonts', express.static(__dirname + '/webfonts'));
Upvotes: 1