()
| 49 | } |
| 50 | |
| 51 | function run(): void { |
| 52 | const port = process.env['PORT'] || 4000; |
| 53 | |
| 54 | // Start up the Node server |
| 55 | const server = app(); |
| 56 | server.listen(port, () => { |
| 57 | console.log(`Node Express server listening on http://localhost:${port}`); |
| 58 | }); |
| 59 | } |
| 60 | |
| 61 | // The below code is to ensure that the server is run only when not requiring the bundle. |
| 62 | const isMain = process.argv[1]?.includes('server'); |