router.get("/test", async (req, res) => {try{let result = await doSomethingAsynchronus();res.send(result);}catch (err) {res.status(500).send({message:err});}});orrouter.get("/test", (req, res) => {doSomethingAsynchronus().then(result)=>{res.send(result);}).catch(err=>{res.status(500).send({message:err});});
Submitted June 27, 2020 at 04:00PM by dc2015bd
No comments:
Post a Comment