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

feat: add healthcheck handler & register it as endpoint #49

Merged

Conversation

MikaelVallenet
Copy link
Contributor

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'

@MikaelVallenet MikaelVallenet requested a review from a team as a code owner August 2, 2024 15:59
@MikaelVallenet MikaelVallenet requested review from deelawn and piux2 and removed request for a team August 2, 2024 15:59
@zivkovicmilos zivkovicmilos self-requested a review August 4, 2024 09:34
Copy link
Member

@zivkovicmilos zivkovicmilos left a 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 🙏

faucet.go Outdated Show resolved Hide resolved
handler.go Outdated Show resolved Hide resolved
faucet.go Outdated Show resolved Hide resolved
Copy link
Member

@zivkovicmilos zivkovicmilos left a 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 🙏

@zivkovicmilos zivkovicmilos merged commit 88dfbea into gnolang:main Aug 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

[infra] GnoFaucet - Create Healthcheck enpoint
2 participants