Skip to content

Instantly share code, notes, and snippets.

@amandeepmittal
Created December 3, 2018 04:35
Show Gist options
  • Save amandeepmittal/b7dd5fb4e1371a1199e3f33b485ffabb to your computer and use it in GitHub Desktop.
Save amandeepmittal/b7dd5fb4e1371a1199e3f33b485ffabb to your computer and use it in GitHub Desktop.
const Todo = require('../models').Todo;
module.exports = {
create(req, res) {
return Todo.create({
title: req.body.title
})
.then(todo => res.status(201).send(todo))
.catch(error => res.status(400).send(error));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment