router.post('/post', function(req,res){
var currentUser = req.session.user;
var post = new Post(currentUser.name, req.body.post);
post.save(function(err){
if(err){
req.flash('error', err);
return res.redirect('/');
}
req.flash('success', 'post success.');
res.redirect('/u/'+ currentUser.name);
});
});
用 bluebird 该怎么写呢, bluebird的api看的有点糊涂 new Promise(function(function resolve, function reject) resolver) -> Promise