Skip to content

Commit

Permalink
fix: add health check endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
wenxing-wang-ey committed Jan 24, 2025
1 parent 9255486 commit 33d8122
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release updated
on:
push:
branches:
- swati/updateImages
- wenxing/updateImages

jobs:
BuildDockerImage:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
build-args: |
GPR_TOKEN=${{ secrets.GPR_TOKEN }}
tags: |
ghcr.io/eyblockchain/timber-updated:latest
ghcr.io/eyblockchain/multiple-contracts:with-health-check
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
push: true
Expand Down
11 changes: 11 additions & 0 deletions merkle-tree/src/routes/node.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,16 @@ async function getRoot(req, res, next) {
}
}

async function getHealthCheck(req, res, next) {
try {
res.data = "Ok";
next();
} catch (err) {
next(err);
}
}


// initializing routes
export default function(router) {
// NODE ROUTES
Expand Down Expand Up @@ -237,4 +247,5 @@ export default function(router) {
// ROOT ROUTES

router.route('/root').get(getRoot);
router.route('/healthcheck').get(getHealthCheck);
}

0 comments on commit 33d8122

Please # to comment.