Created
March 4, 2017 23:30
-
-
Save makefunstuff/f5e2915d190c19ef1b057e0fce1d72fd 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) => { | |
| logger('[INFO] data is received'); | |
| tracking('data.received', {id: id}); | |
| return res.json(data); | |
| }) | |
| .catch(next); | |
| }); | |
| app.get('/data/:entry_id/filtered', (req, res, next) => { | |
| const { entry_id } = req.params; | |
| database.getById(id) | |
| .then((data) => dataFilterService({id: data})) | |
| .then((apiResult) => { | |
| logger('[INFO] data is filtered'); | |
| tracking('api.result.received'); | |
| res.json(apiResult); | |
| }) | |
| .catch(next); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment