在Express中包含Bootstrap Glyphicons
我试图在快速应用程序中使用glyphicons(通过bootstrap)。 问题是当我服务我的静态文件,graphics不包括在内。
这是我的目录(由grunt创build):
Build fonts glyphicons-halflings.eot ... js scripts.js stylesheets styles.css
这是我的app.js代码:
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')));
这是从铬的错误:
用户:GET GET http:// localhost:3000 / fonts / glyphicons-halflings-regular.woff 404(Not Found)发现)
我试过切换到
app.use('/build/', express.static(path.join(__dirname, 'build/fonts')));
但我很确定bootstrap正在寻找../fonts,所以目录不能完全相同。 换句话说,bootstrap期望的结构是这样的:
js/bootstrap.js fonts/glyphs
我在哪里?
感谢大家!
只需使用以下内容:
app.use('/fonts/', express.static(path.join(__dirname, 'build/fonts')));