-
-
Save Marak/2431401 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.router.get('/:slug', function (slug) { | |
var that = this; | |
Shortlink.find( {slug: slug} , function (err, shortlink) { | |
if (err) { throw new(Error)(err) } | |
console.log( that.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