Skip to content

Commit

Permalink
Merge 1b76972 into af7bfa3
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-W committed Mar 15, 2019
2 parents af7bfa3 + 1b76972 commit 5946e63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ let server = new FHIRServer(SERVER_CONFIG)
.configureMiddleware()
.configurePassport()
.configureHelmet()
.enableHealthCheck()
.setProfileRoutes()
.setErrorRoutes();

Expand Down
10 changes: 10 additions & 0 deletions src/lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ class Server {
return this;
}

// enable health check
enableHealthCheck () {
// just send a simple 200 response for healthcheck
this.app.use('/healthcheck', (_req, res) =>
res.status(200).json({ uptime: process.uptime() })
);
// return self for chaining
return this;
}

// Setup profile routes
setProfileRoutes() {
this.logger.info('Loading GraphQL schemas and setting routes');
Expand Down

0 comments on commit 5946e63

Please sign in to comment.