gulp + express4.x 版本,调试通过,release 0.1.1, https://github.com/wk633/movie-site/releases/tag/0.1.1, 有需要的可以参考下
2016-12-15
es6 ejs express4.4 重写,可以参考https://github.com/cllgeek/movie-project/tree/movie-project-2
2016-12-09
app.use((req,res,next)=>{
const _user=req.session.user
if(_user){
app.locals.user=_user
}
next()
})
是不需要if判断的 直接 app.locals.user=_user
const _user=req.session.user
if(_user){
app.locals.user=_user
}
next()
})
是不需要if判断的 直接 app.locals.user=_user
2016-12-02
最近的版本已经不需要依赖cookie-parser
//var cookieParser = require('cookie-parser')
var session = require('express-session')
//app.use(cookieParser())
app.use(session({
secret: 'imooc',
resave: false,
saveUninitialized: true
}))
//var cookieParser = require('cookie-parser')
var session = require('express-session')
//app.use(cookieParser())
app.use(session({
secret: 'imooc',
resave: false,
saveUninitialized: true
}))
2016-11-30