node.js - Including Bootstrap Glyphicons In Express -
i'm trying use glyphicons (via bootstrap) in express app. problem when i'm serving static files, glyphicons aren't included.
this directory (created grunt):
build fonts glyphicons-halflings.eot ... js scripts.js stylesheets styles.css
here app.js code:
app.use('/build/', express.static(path.join(__dirname, 'build/js'))); app.use('/build/', express.static(path.join(__dirname, 'build/stylesheets'))); app.use(express.static(path.join(__dirname, 'build/fonts')));
here error chrome:
users:1 http://localhost:3000/fonts/glyphicons-halflings-regular.woff 404 (not found) users:1 http://localhost:3000/fonts/glyphicons-halflings-regular.ttf 404 (not found)
i've tried switching
app.use('/build/', express.static(path.join(__dirname, 'build/fonts')));
but i'm pretty sure bootstrap looking ../fonts, dir can't quite same. in other words, bootstrap expecting structure so:
js/bootstrap.js fonts/glyphs
where off?
thanks everyone!
just use following then:
app.use('/fonts/', express.static(path.join(__dirname, 'build/fonts')));
Comments
Post a Comment