Skip to content

Instantly share code, notes, and snippets.

@desmondmorris
Created April 20, 2012 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save desmondmorris/2431305 to your computer and use it in GitHub Desktop.
Save desmondmorris/2431305 to your computer and use it in GitHub Desktop.
app.router.get('/:slug', function (slug) {
Shortlink.find( {slug: slug} , function (err, shortlink) {
if (err) { throw new(Error)(err) }
console.log( this.req ); // This returns "undefined" and I think I understand why.
// How do I access request and response objects from within
// an anon callback like this one?
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment