mongoose and express get requests

Solutions on MaxInterview for mongoose and express get requests by the best coders in the world

showing results for - "mongoose and express get requests"
Kaden
25 Jul 2018
1app.get('/api/all', (req,res) =>{
2     Model.find({})
3       .then(model=> {
4         res.json(model)
5     }).catch(error=>{
6         res.json(error)
7        }
8     })
9})