(sslKey, sslCert)
| 28 | } |
| 29 | |
| 30 | function readSSLandCert(sslKey, sslCert) { |
| 31 | if (!fs.existsSync(sslKey)) { |
| 32 | throw new TypeError( |
| 33 | `SSL key couldn't be found in "${sslKey}", ` + `please provide a path to an existing ssl key file with --ssl-key` |
| 34 | ); |
| 35 | } |
| 36 | |
| 37 | if (!fs.existsSync(sslCert)) { |
| 38 | throw new TypeError( |
| 39 | `SSL certificate couldn't be found in "${sslCert}", ` + |
| 40 | `please provide a path to an existing ssl certificate file with --ssl-cert` |
| 41 | ); |
| 42 | } |
| 43 | |
| 44 | let key = fs.readFileSync(sslKey); |
| 45 | let cert = fs.readFileSync(sslCert); |
| 46 | return { key, cert }; |
| 47 | } |
| 48 | |
| 49 | const DEFAULT_PREFIX = '/'; |
| 50 |
no outgoing calls
no test coverage detected
searching dependent graphs…