Created
January 20, 2011 18:36
-
-
Save flippyhead/788348 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
SessionsController = function() { | |
function SessionsController() { | |
this.x = 1; | |
} | |
SessionsController.prototype.init = function(req, res, next) { | |
return console.log(this); | |
}; | |
return SessionsController; | |
}(); | |
// In my express app: | |
sessionsController = new SessionsController() | |
sessionsController.init() // console.log --> {x: 1} | |
// App Routes | |
app.all '/', sessionsController.init // on request, console.log --> { route: '', handle: [Function: router] }, where is X? | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment