Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates how the the axum router constructed for
dx serve
, the--open
option, and the dioxus-routerWebHistory
interact with the Dioxus.tomlbase_path
field.Prior to this change, running
dx serve
with abase_path
set always resulted in my browser displaying the "Outside of the base path: blah" message, even when I was navigating to routes that were very definitely inside of the base path.Three major changes are included in this PR;
base_path
now causes thedx serve
router to be nested under the base path, rather than treating the base path as a route that is handled with aaxum::routing::any_service
.--open
flag now opens tolocalhost:8080/<base_path>
rather than tolocalhost:8080
.This last change is actually what I consider to be the most important, as it impacts dioxus web applications hosted outside of the
dx serve
axum server. Without this change, navigating to e.g.localhost:8080/base/path/
would cause the browser address bar to resolve tolocalhost:8080
, even though following aLink { to: Route::Home {}, .. }
would pushlocalhost:8080/base/path/
onto the history stack.