在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')));
- SequelizeInstance对象不在Express Handlebars视图中呈现(NodeJS,Express)
- 导入path不能以'.ts'结尾 – NodeJS和Visual Code
- 在快速响应对象上获取Cookie数据?
- express.js有一个主目录的概念吗?
- (Express js 4 Multer)在file upload前检查表单域(如果为空)
- SailsJS Passport会话持久性问题:摩卡testing失败
- Express-Generator(NodeJS)的'npm start'
- `app.get(“/”,func1,func2);`和app.get(“/”,func1)一样。 app.get(“/”,func2);`?
- 如何在sails.js中创builddynamic策略