Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- router.route("/").get((req, res) => {
- Todo.find()
- .then(todos => res.json(todos))
- .catch(err => res.status(400).json("Error: " + err));
- });
- router.get('/', async (req, res) => {
- return res.json(await Todo.find());
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement