Permalink
Browse files

Changes the exposure points to be compatible with the latest version …

…of express.
  • Loading branch information...
1 parent 450dc3e commit ba34bb4e20b046c9c494f69669760c1880990155 @thatguydan thatguydan committed Apr 19, 2012
Showing with 5 additions and 7 deletions.
  1. +5 −7 index.js
View
@@ -9,9 +9,7 @@
*/
var express = require('express')
- , join = require('path').join
- , HTTPServer = express.HTTPServer
- , HTTPSServer = express.HTTPSServer;
+ , join = require('path').join;
/**
* Namespace using the given `path`, providing a callback `fn()`,
@@ -51,8 +49,8 @@ exports.__defineGetter__('currentNamespace', function(){
* Proxy HTTP methods to provide namespacing support.
*/
-express.router.methods.concat('del').forEach(function(method){
- var orig = HTTPServer.prototype[method];
+(express.router || express.Router).methods.concat('del').forEach(function(method){
+ var orig = express.application[method];
exports[method] = function(){
var args = Array.prototype.slice.call(arguments)
, path = args.shift()
@@ -78,6 +76,6 @@ express.router.methods.concat('del').forEach(function(method){
for (var key in exports) {
var desc = Object.getOwnPropertyDescriptor(exports, key);
- Object.defineProperty(HTTPServer.prototype, key, desc);
- Object.defineProperty(HTTPSServer.prototype, key, desc);
+ Object.defineProperty(express.application, key, desc);
+ Object.defineProperty(express.application, key, desc);
}

0 comments on commit ba34bb4

Please sign in to comment.