Skip to content

Instantly share code, notes, and snippets.

@cobalt88
Last active June 23, 2022 00:57
Show Gist options
  • Select an option

  • Save cobalt88/b5295314c58d4c70327d4e631caa3004 to your computer and use it in GitHub Desktop.

Select an option

Save cobalt88/b5295314c58d4c70327d4e631caa3004 to your computer and use it in GitHub Desktop.
JS Templates - Non Commented
router.get('/', async(req,res) => {
try {
const response = await
res.status(200).json(response);
} catch (err) {
res.status(500).json({message: `Unexpected error encountered in (route name here): ${err} \n ${err.message}`});
console.log(`Unexpected error encountered in (route name here): ${err} \n ${err.message}`);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment