Skip to content

Instantly share code, notes, and snippets.

@makefunstuff
Created March 4, 2017 23:28
Show Gist options
  • Save makefunstuff/f124d8b680af8a036e7e78b3bed0fd5c to your computer and use it in GitHub Desktop.
Save makefunstuff/f124d8b680af8a036e7e78b3bed0fd5c to your computer and use it in GitHub Desktop.
app.get('/data/:entry_id', (req, res, next) => {
const { entry_id } = req.params;
database.getById(id)
.then((data) => {
return res.json(data);
})
.catch((error) => {
logger('[ERROR] ', error.message);
exceptionCatcher(error);
res.status(500).json({
error: 'Something went wrong'
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment