I use express to serve static content on my site and I want to incorporate FontAwesome (
npm install font-awesome
var express = require('express')
var app = express()
// response 200 | /static/font-awesome.min.css
// error 404 | /static/fontawesome--webfont.woff?v=4.6.3
When your browser requests
/static/fontawesome--webfont.woff?v=4.6.3, the server is free to ignore the
?v=xxx part. And that's what is done by the
express.static module. The point of that part is to prevent browsers and proxies from using an old version of the file.
So the problem isn't where you think it is. The problem is you map the static
route to two servers. The first one doesn't find the file and issues a 404.
Change your mapping
and change the URLs:
I say it's dirty because you're serving the unchecked content of a node modules (which is updated when you do a npm update). You should never do that.
Create a static directory (the name doesn't matter) and put inside the contents of the
./node_modules/font-awesome/fonts directories then just map it using