(options, Server)
| 117 | } |
| 118 | |
| 119 | createServer(options, Server) { |
| 120 | let serverOptions = { |
| 121 | app: this.app, |
| 122 | dashboard: 'false', |
| 123 | prefix: DEFAULT_PREFIX, |
| 124 | port: options.port, |
| 125 | }; |
| 126 | if (options.ssl) { |
| 127 | let { key, cert } = readSSLandCert(options.sslKey, options.sslCert); |
| 128 | serverOptions.key = key; |
| 129 | serverOptions.cert = cert; |
| 130 | } |
| 131 | let lrServer = new Server(serverOptions); |
| 132 | |
| 133 | // this is required to prevent tiny-lr from triggering an error |
| 134 | // when checking this.server._handle during its close handler |
| 135 | // here: https://github.com/mklabs/tiny-lr/blob/d68d983eaf80b5bae78b2dba259a1ad5e3b03a63/lib/server.js#L209 |
| 136 | lrServer.server = this.httpServer; |
| 137 | |
| 138 | return lrServer; |
| 139 | } |
| 140 | |
| 141 | createServerforCustomPort(options, Server) { |
| 142 | let instance; |
no test coverage detected