Skip to content

Instantly share code, notes, and snippets.

@makefunstuff
Created March 4, 2017 23:31
Show Gist options
  • Save makefunstuff/b55b5a9a1d833fef2527a79e48040c6a to your computer and use it in GitHub Desktop.
Save makefunstuff/b55b5a9a1d833fef2527a79e48040c6a to your computer and use it in GitHub Desktop.
app.get('/data/:entry_id', (req, res, next) => {
next();
});
app.get('/data/:entry_id/filtered', (req, res, next) => {
dataFilterService(req.result)
.then((apiResult) => {
req.metadata = {
info: 'data is filtered',
event: 'api.result.received'
}
req.result = apiResult;
next();
})
.catch(next);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment