Skip to content

Commit

Permalink
fix: handle root path in automatic routing (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmearl committed Feb 5, 2025
1 parent 060c954 commit a3e422c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions solara/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,14 @@ def resolve_path(path_or_route: Union[str, solara.Route], level=0) -> str:
if path.startswith("/"):
return path
route_level = solara.get_context(route_level_context) + level
parts = [*router.parts[:route_level], path]
parts = [router.root_path or "", *router.parts[:route_level], path]
path = "/" + "/".join(parts)
if path.startswith("//"):
path = path[1:]
return path
elif isinstance(path_or_route, solara.Route):
route: solara.Route = path_or_route
path = _resolve_path("/", route, router.routes)
path = _resolve_path(router.root_path or "/", route, router.routes)
if path.startswith("//"):
path = path[1:]
return path
Expand Down

0 comments on commit a3e422c

Please sign in to comment.