Skip to content

Instantly share code, notes, and snippets.

@leosilvadev
Created March 19, 2016 01:37
Show Gist options
  • Select an option

  • Save leosilvadev/be5080fef0372a828d67 to your computer and use it in GitHub Desktop.

Select an option

Save leosilvadev/be5080fef0372a828d67 to your computer and use it in GitHub Desktop.
app.post('/usuarios', function(req, res){
new model.Usuario({nome:'Qualquer'}}).save(function(error, data){
if(error){
res.status(400).json({message:error.message});
} else {
res.status(201).json(data);
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment