-
-
Save dpjayasekara/e18aff1f2633bb3b08733f370533e4f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function getUsers() { | |
try { | |
return getUsersFromApi(); | |
} catch (err) { | |
logger.error(err); | |
throw err; | |
} | |
} | |
router.get('/users', async (req, res) => { | |
try { | |
res.status(200).send(await getUsers()); | |
} catch (err) { | |
logger.error(err); | |
res.status(500).send('something went wrong'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment