()
| 10 | import { createServer } from 'http' |
| 11 | |
| 12 | function getPortOrDefault() { |
| 13 | const port = process.env.PORT |
| 14 | if (port != null) { |
| 15 | const result = parseInt(port) |
| 16 | if (isNaN(result)) { |
| 17 | throw new Error(`Unable to parse '${port}' into valid number`) |
| 18 | } |
| 19 | return result |
| 20 | } |
| 21 | |
| 22 | return 3000 |
| 23 | } |
| 24 | |
| 25 | function startApp() { |
| 26 | const runningApp = run({ stdio: 'inherit' }) |