Lund-Org/cherry

View on GitHub
src/server/CherryHTTPSServer.js

Summary

Maintainability
A
0 mins
Test Coverage
const https = require('https')
const CherryServer = require('./CherryServer')
const CherryIncomingMessage = require('./CherryIncomingMessage')
const CherryServerResponse = require('./CherryServerResponse')

class CherryHTTPSServer extends CherryServer {
  /**
   * Create the HTTPS server with custom request and response class
   */
  create () {
    this.server = https.createServer(
      Object.assign({
        IncomingMessage: CherryIncomingMessage,
        ServerResponse: CherryServerResponse
      }, this.options.httpsOptions),
      (req, res) => {
        this.bootstrap(req, res)
      }
    )
  }
}

module.exports = CherryHTTPSServer