Answers for "mongoose and express get requests"

1

mongoose and express get requests

app.get('/api/all', (req,res) =>{
     Model.find({})
       .then(model=> {
         res.json(model)
     }).catch(error=>{
         res.json(error)
        }
     })
})
Posted by: Guest on November-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language