Created
March 4, 2017 23:28
-
-
Save makefunstuff/f124d8b680af8a036e7e78b3bed0fd5c 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
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