Skip to content

Instantly share code, notes, and snippets.

@OwenBrotherwood
Created May 24, 2015 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OwenBrotherwood/a58ea13cf54c44ce73c5 to your computer and use it in GitHub Desktop.
Save OwenBrotherwood/a58ea13cf54c44ce73c5 to your computer and use it in GitHub Desktop.
pulkitsinghal audit
pulkitsinghal
// -- Add your pre-processing middleware here --
app.all('/api/*', function auditApiCalls(req, res, next) {
if (req.accessToken) {
log('url:', req.originalUrl, 'userId:', req.accessToken.id, 'token:', JSON.stringify(req.accessToken,null,0));
}
else {
log('url:', req.originalUrl, 'token:', req.accessToken);
}
next();
});
@OwenBrotherwood
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment