Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactored https.js

  • Loading branch information...
commit 4efb25d04839d70e8c9b59b8e831996848e27bce 1 parent a3678cd
@tj tj authored
Showing with 15 additions and 3 deletions.
  1. +15 −3 lib/https.js
View
18 lib/https.js
@@ -14,6 +14,18 @@ var connect = require('connect')
, https = require('https');
/**
+ * Expose `HTTPSServer`.
+ */
+
+exports = module.exports = HTTPSServer;
+
+/**
+ * Server proto.
+ */
+
+var app = HTTPSServer.prototype;
+
+/**
* Initialize a new `HTTPSServer` with the
* given `options`, and optional `middleware`.
*
@@ -22,7 +34,7 @@ var connect = require('connect')
* @api public
*/
-var Server = exports = module.exports = function HTTPSServer(options, middleware){
+function HTTPSServer(options, middleware){
connect.HTTPSServer.call(this, options, []);
this.init(middleware);
};
@@ -31,10 +43,10 @@ var Server = exports = module.exports = function HTTPSServer(options, middleware
* Inherit from `connect.HTTPSServer`.
*/
-Server.prototype.__proto__ = connect.HTTPSServer.prototype;
+app.__proto__ = connect.HTTPSServer.prototype;
// mixin HTTPServer methods
Object.keys(HTTPServer.prototype).forEach(function(method){
- Server.prototype[method] = HTTPServer.prototype[method];
+ app[method] = HTTPServer.prototype[method];
});
Please sign in to comment.
Something went wrong with that request. Please try again.