a1ee8a89a7
* chore(server): graceful shutdown - stop() on the apollo server should be called * chore(server): gracefully drain apollo server * Allow grace period to be configured * Terminus manages the readiness and liveness endpoints * terminus is responsible for stopping the graphql server * remove logging on shutdown * Remove redundant parameter * move healthchecks out of business modules to top-level directory - terminus can only handle readiness check, not liveness - app needs to return readiness handler, so that server terminus can use it * fix tests * Fix broken merge * fix broken merge * incorporate review comments * fix invalid merge * fix readinesscheck not being passed as parameter
19 lines
442 B
JavaScript
Executable File
19 lines
442 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
'use strict'
|
|
|
|
const { logger } = require('../dist/logging/logging')
|
|
const { init, startHttp } = require('../dist/app')
|
|
|
|
init()
|
|
.then(({ app, graphqlServer, server, readinessCheck }) =>
|
|
startHttp({ app, graphqlServer, server, readinessCheck })
|
|
)
|
|
.catch((err) => {
|
|
logger.error(err, 'Failed to start server. Exiting with non-zero exit code...')
|
|
|
|
// kill it with fire 🔥
|
|
process.exit(1)
|
|
})
|
|
|
|
// 💥
|