Skip to content

Commit 81251de

Browse files
committed
Revert "fix(service): fix url prefixing for subgraphs route"
This reverts commit ab9de29.
1 parent 9930b7b commit 81251de

File tree

2 files changed

+5
-22
lines changed

2 files changed

+5
-22
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/service/src/service/router.rs

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -383,28 +383,11 @@ impl ServiceRouter {
383383
};
384384

385385
// data layer
386-
let subgraphs_route = Router::new()
387-
.route(
388-
&{
389-
if url_prefix == "/" {
390-
// If prefix is root, just add the route directly
391-
"/subgraphs/id/{id}".to_string()
392-
} else {
393-
// Otherwise, nest it
394-
format!("{}/subgraphs/id/{{id}}", url_prefix)
395-
}
396-
},
397-
post_request_handler,
398-
)
386+
let data_routes = Router::new()
387+
.route("/subgraphs/id/{id}", post_request_handler)
399388
.with_state(graphnode_state.clone());
400389

401-
// let subgraphs_route = if url_prefix == "/" {
402-
// // If prefix is root, just add the route directly
403-
// data_routes.route("/subgraphs/id/{id}", post_request_handler)
404-
// } else {
405-
// // Otherwise, nest it
406-
// data_routes.route(&format!("{}/subgraphs/id/{{id}}", url_prefix), post_request_handler)
407-
// };
390+
let subgraphs_route = Router::new().nest(&url_prefix, data_routes);
408391

409392
let misc_routes = Router::new()
410393
.route("/", get("Service is up and running"))

0 commit comments

Comments
 (0)