Skip to content

Commit

Permalink
[GraphQL] Add health endpoint to version routes as well (#18580)
Browse files Browse the repository at this point in the history
Add health endpoint to version routes as well.

How did you test the new or updated feature?

---

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] Indexer:
- [ ] JSON-RPC:
- [x] GraphQL: Added the health endpoint to version routes as well.
- [ ] CLI:
- [ ] Rust SDK:
  • Loading branch information
stefan-mysten committed Jul 9, 2024
1 parent 887da4e commit a60731c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion crates/sui-graphql-rpc/src/server/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ impl ServerBuilder {
.route("/:version", post(graphql_handler))
.route("/graphql", post(graphql_handler))
.route("/graphql/:version", post(graphql_handler))
.route("/health", axum::routing::get(health_checks))
.route("/health", get(health_check))
.route("/graphql/health", get(health_check))
.route("/graphql/:version/health", get(health_check))
.with_state(self.state.clone())
.route_layer(CallbackLayer::new(MetricsMakeCallbackHandler {
metrics: self.state.metrics.clone(),
Expand Down

0 comments on commit a60731c

Please sign in to comment.