I'm making an app with express and mongoose, https://github.com/findjashua/express_app
app.coffee
app.post '/user', user.add
models/user.coffee
createUser = (req) -> user = new User name : req.body.name email : req.body.email phone : req.body.phone return user # ... exports.add = (req, res) -> user = createUser req res.send dbService.save(user)
services/db.coffee
exports.save = (document)-> document.save (err)-> if err console.log err return document
When I make a post request to add a new user, it doesn't save anything and I can't think of any reason why. Any ideas?