Created
October 15, 2017 00:37
-
-
Save itsMapleLeaf/e079f77e462bf8a3a6a849dff1aec5c3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
router.get(':/category', async (req, res) => { | |
try { | |
const category = await Category.findOne({ /* ... */ }) | |
const posts = await Post.findAll({ /* ... */ }) | |
res.render(/* ... */) | |
} catch (err) { | |
console.error(err) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kingdaro you can also do:
this assumes you have an error handler defined after your router(s)