Permalink
Browse files

* binding app on handler.

* bump version to 0.0.7
  • Loading branch information...
1 parent fe5afe1 commit 300c6ae2500b64b2de7eaa0c9305c32191044e72 @cfsghost committed Dec 5, 2013
Showing with 3 additions and 3 deletions.
  1. +2 −2 lib/courser.js
  2. +1 −1 package.json
View
@@ -21,7 +21,7 @@ Courser.prototype.addHandler = function(routePath, method, routeObj) {
if (routeObj instanceof Function) {
// Using Express API to register route path
- self.app[method](routePath, routeObj);
+ self.app[method](routePath, routeObj.bind(self.app));
} else if (routeObj instanceof Array) {
@@ -41,7 +41,7 @@ Courser.prototype.addHandler = function(routePath, method, routeObj) {
var handler = routeObj[index];
// Using Express API to register route path
- self.app[method](routePath, middleware, handler);
+ self.app[method](routePath, middleware, handler.bind(self.app));
} else if (routeObj instanceof Object) {
View
@@ -1,6 +1,6 @@
{
"name": "courser",
- "version": "0.0.6",
+ "version": "0.0.7",
"description": "Route manager for express web framework",
"keywords": [
"web",

0 comments on commit 300c6ae

Please sign in to comment.