我想问一下admin post movie那里的路由 Movie.findById这个方法是怎么来的?我记得在模式里封装好的是fetchById,难道不报错吗?
2016-06-21
老师这个视频的express还没有升级到4.0.因此大家安装express可以安装3.0版本,比较容易对上代码。在npm中直接安装对应版本
npm install express@3.0.0
npm install express@3.0.0
2016-06-17
TypeError: Cannot read property 'id' of undefined
at /Users/anhao/Desktop/node/movieProject/app.js:107:23
at Layer.handle [as handle_request] (/Users/anhao/Desktop/node/movieProject/node_modules/express/lib/router/layer.js:95:5)
at /Users/anhao/Desktop/node/movieProject/app.js:107:23
at Layer.handle [as handle_request] (/Users/anhao/Desktop/node/movieProject/node_modules/express/lib/router/layer.js:95:5)
2016-06-17
var path = require('path');
// console.log(path);
app.set('views',path.join(__dirname,'./views'));
就可以解决 :Error: Failed to lookup view "index" in views directory "./views"
// console.log(path);
app.set('views',path.join(__dirname,'./views'));
就可以解决 :Error: Failed to lookup view "index" in views directory "./views"
2016-06-15