-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: add healthcheck handler & register it as endpoint #49
feat: add healthcheck handler & register it as endpoint #49
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution 🙏
Looks good, the only thing that needs to be changed is making the health endpoint optional -- it should always be on. Please remove related optional functionality for it, and check the linter 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the quick fix 🙏
close gnolang/gno#2650
I've taken the initiative of integrating the addition of the healthcheck feature directly into the faucet pkg, with an option to enable/disable it (enabled by default), because I think it can avoid having to develop this common feature on several projects.
Also, the faucet currently creates a new HTTP router, so to add it externally you'd have to export the router or add an option to set the faucet router when it's created (requiring you to modify both the faucet pkg and the overlay in the gno main repository).
The endpoint can be ping like this:
curl --location --request GET 'http://localhost:8545/health'