summaryrefslogtreecommitdiff
path: root/node_modules/express/lib/https.js
blob: 8a8c008ae269378319b0981269fd202a92232872 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*!
 * Express - HTTPSServer
 * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
 * MIT Licensed
 */

/**
 * Module dependencies.
 */

var connect = require('connect')
  , HTTPServer = require('./http')
  , 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`.
 *
 * @param {Object} options
 * @param {Array} middleware
 * @api public
 */

function HTTPSServer(options, middleware){
  connect.HTTPSServer.call(this, options, []);
  this.init(middleware);
};

/**
 * Inherit from `connect.HTTPSServer`.
 */

app.__proto__ = connect.HTTPSServer.prototype;

// mixin HTTPServer methods

Object.keys(HTTPServer.prototype).forEach(function(method){
  app[method] = HTTPServer.prototype[method];
});