Advertisement
KoctrX

Untitled

Mar 19th, 2021
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. router.route("/").get((req, res) => {
  2.     Todo.find()
  3.         .then(todos => res.json(todos))
  4.         .catch(err => res.status(400).json("Error: " + err));
  5. });
  6.  
  7.  
  8. router.get('/', async (req, res) => {
  9.     return res.json(await Todo.find());
  10. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement