Skip to content

Commit

Permalink
easy/chore: support nesting in starting res-api (MystenLabs#14309)
Browse files Browse the repository at this point in the history
## Description 

Allows specifying where to nest

## Test Plan 

Manual

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
oxade authored Oct 17, 2023
1 parent c5ae3de commit be16c7d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/sui-rest-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ pub fn rest_router(state: std::sync::Arc<dyn NodeStateGetter>) -> Router {
pub async fn start_service(
socket_address: std::net::SocketAddr,
state: std::sync::Arc<dyn NodeStateGetter>,
base: Option<String>,
) {
let app = rest_router(state);
let app = if let Some(base) = base {
Router::new().nest(&base, rest_router(state))
} else {
rest_router(state)
};

axum::Server::bind(&socket_address)
.serve(app.into_make_service())
Expand Down

0 comments on commit be16c7d

Please sign in to comment.