()
| 38 | } |
| 39 | |
| 40 | async function startServer () { |
| 41 | // get oracle connection |
| 42 | await dbConnect() |
| 43 | console.log('Oracle database connection established') |
| 44 | |
| 45 | terminus.createTerminus(http.createServer(app), { |
| 46 | logger: console.log, |
| 47 | signal: 'SIGINT', |
| 48 | healthChecks: { |
| 49 | '/healthcheck': onHealthCheck |
| 50 | }, |
| 51 | |
| 52 | onSignal |
| 53 | }).listen(3000) |
| 54 | } |
| 55 | |
| 56 | startServer() |
| 57 | .catch(err => console.error('connection error', err.stack)) |