动手和最佳实践是学习一门语言或框架的最佳方式。
分享node-blog-starter,使用Express + Mongoose + Ejs实现的个人博客系统。
我是刚学Node.js的新手,写得不好的地方还请大帮忙之处,谢谢。
最后,希望能够帮到有需要的同学~
同楼主一样,大三学生一枚,同样推荐一个吧,曾在社区有人推荐过的 https://github.com/nswbmw/N-blog 看完这个,我现在在看cnode社区的开源项目 https://github.com/cnodejs/nodeclub/
我npm install bcrypt 出错
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 139
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the bcrypt package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bcrypt
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.2.0 npm ERR! command “node” “/usr/local/bin/npm” “install” “bcrypt” npm ERR! cwd /Users/harvey850331/Sites/Harvey-nodejsblog npm ERR! node -v v0.8.2 npm ERR! npm -v 1.4.21 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! /Users/harvey850331/Sites/Harvey-nodejsblog/npm-debug.log npm ERR! not ok code 0 找不到原因 请教一下
@HanweiHuang locals是拿来设置全局助手函数的,然后你就可以在模板中使用这个函数了。
// app.js
var app = express();
app.locals.moment= require('moment');