我的玉模板找不到引导资产。它抛出以下 404。(/loadMedia是加载layout.jade的调用路由,成功。)
我究竟做错了什么?
GET /loadMedia 200 19ms - 572
GET /assets/js/jquery-1.8.3.min.js 404 2ms
GET /assets/css/bootstrap.min.css 404 2ms
GET /assets/js/bootstrap-dropdown.js 404 1ms
GET /assets/js/bootstrap.min.js 404 2ms
GET /assets/js/bootstrap.js 404 3ms
应用程序配置:
app.configure(function(){
app.set('port', process.env.PORT || 3000);
app.set('views', __dirname + '/views/templates');
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(__dirname, 'public'));
});
我的文件夹结构:
.
├── README.md
├── app.js
├── node_modules
│ ├── express
│ ├── jade
│ └── mongodb
├── package.json
├── routes
└── views
├── assets
│ ├── css
│ │ ├── bootstrap-responsive.css
│ │ ├── bootstrap-responsive.min.css
│ │ ├── bootstrap.css
│ │ └── bootstrap.min.css
│ ├── img
│ └── js
│ ├── bootstrap-dropdown.js
│ ├── bootstrap.js
│ ├── bootstrap.min.js
│ └── jquery-1.8.3.min.js
└── templates
├── layout.jade
└── loadMedia.jade
这是我的 layout.jade:
!!! 5
html
head
script(type="text/javascript", src="../assets/js/jquery-1.8.3.min.js")
script(type='text/javascript', src='../assets/js/bootstrap.js')
script(type='text/javascript', src='../assets/js/bootstrap.min.js')
script(type='text/javascript', src='../assets/js/bootstrap-dropdown.js')
link(rel='stylesheet', type='text/css', href='../assets/css/bootstrap.min.css')
style
body
{
padding-top: 40px;
padding-bottom: 40px;
background-color: #f5f5f5;
}
.search-query
{
margin-top: 5px;
margin-right: 2px;
}