Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add health endpoint via nginx #1068

Merged
merged 4 commits into from
Oct 31, 2024
Merged

Add health endpoint via nginx #1068

merged 4 commits into from
Oct 31, 2024

Conversation

ljones140
Copy link
Contributor

@ljones140 ljones140 commented Oct 30, 2024

Adds a health endpoint which returns app version and sha.

{"status":"OK", "version": "2.2.1", "sha": "12345"}

Endpoint has been implemented via nginx.
As the site is a React page the alternative would have been adding a Node.js endpoint the app would need to expose.
Using nginx is a lot less complex and easier to maintain in the future

Deployed to development and it's working:

curl https://dev.clearlydefined.io/health
=> {"status":"OK", "version": "v0.1.1-dev-654d7fca75", "sha": "654d7fca7516735b2e9891b8657352cf3b3e0a4e"}

Copy link

netlify bot commented Oct 30, 2024

Deploy Preview for blissful-goodall-fa23f6 ready!

Name Link
🔨 Latest commit 813365f
🔍 Latest deploy log https://app.netlify.com/sites/blissful-goodall-fa23f6/deploys/67229112f3ca7400081c2bc9
😎 Deploy Preview https://deploy-preview-1068--blissful-goodall-fa23f6.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ljones140 ljones140 changed the title Add health endpoint via nginx config Add health endpoint via nginx Oct 30, 2024
Copy link
Collaborator

@elrayle elrayle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic. I'm glad you found an easy solution to make the health end point.

@ljones140 ljones140 marked this pull request as ready for review October 31, 2024 10:34
@ljones140 ljones140 mentioned this pull request Oct 31, 2024
@ljones140 ljones140 merged commit bb31409 into master Oct 31, 2024
18 checks passed
@ljones140 ljones140 deleted the ljones140/nginx-health branch October 31, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants