()
| 62 | } |
| 63 | |
| 64 | createHttpsServer() { |
| 65 | if (!fs.existsSync(this.startOptions.sslKey)) { |
| 66 | throw new TypeError( |
| 67 | `SSL key couldn't be found in "${this.startOptions.sslKey}", ` + |
| 68 | `please provide a path to an existing ssl key file with --ssl-key` |
| 69 | ); |
| 70 | } |
| 71 | |
| 72 | if (!fs.existsSync(this.startOptions.sslCert)) { |
| 73 | throw new TypeError( |
| 74 | `SSL certificate couldn't be found in "${this.startOptions.sslCert}", ` + |
| 75 | `please provide a path to an existing ssl certificate file with --ssl-cert` |
| 76 | ); |
| 77 | } |
| 78 | |
| 79 | let options = { |
| 80 | key: fs.readFileSync(this.startOptions.sslKey), |
| 81 | cert: fs.readFileSync(this.startOptions.sslCert), |
| 82 | }; |
| 83 | |
| 84 | return this.https.createServer(options, this.app); |
| 85 | } |
| 86 | |
| 87 | listen(port, host) { |
| 88 | let server = this.httpServer; |
no test coverage detected