Skip to content

Commit 6bbb7e1

Browse files
committed
add health check
1 parent 4cf5f85 commit 6bbb7e1

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

app.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const cors = require('cors')
1212
const HttpStatus = require('http-status-codes')
1313
const logger = require('./src/common/logger')
1414
const interceptor = require('express-interceptor')
15+
const healthcheck = require('topcoder-healthcheck-dropin')
16+
1517

1618
// setup express app
1719
const app = express()
@@ -48,6 +50,14 @@ app.use(interceptor((req, res) => {
4850
}
4951
}))
5052

53+
// check if api is started
54+
// TODO: check db connection, docusign callback
55+
function check () {
56+
return true;
57+
}
58+
59+
app.use(healthcheck.middleware([check]))
60+
5161
// Register routes
5262
require('./app-routes')(app)
5363

package-lock.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"sequelize": "^5.3.0",
3939
"superagent": "^5.0.2",
4040
"tc-core-library-js": "appirio-tech/tc-core-library-js.git#v2.6.1",
41+
"topcoder-healthcheck-dropin": "^1.0.3",
4142
"winston": "^3.2.1"
4243
},
4344
"standard": {

0 commit comments

Comments
 (0)