Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dx serve should serve http://127.0.0.1:8080/{base_path} not just route #3159

Closed
nigeleke opened this issue Nov 2, 2024 · 4 comments · Fixed by #3247
Closed

dx serve should serve http://127.0.0.1:8080/{base_path} not just route #3159

nigeleke opened this issue Nov 2, 2024 · 4 comments · Fixed by #3247
Labels
bug Something isn't working web relating to the web renderer for dioxus

Comments

@nigeleke
Copy link

nigeleke commented Nov 2, 2024

Feature Request

This is a slight mix between "feature request" and (potentially) bug report.

If a base_path is defined in Dioxus.toml, when I run dx serve locally it serves at http://127.0.0.1:8080. It would seem beneficial to at least have a link to http://127.0.0.1:8080/{base_path}.

I'm currently using the 0.6 alpha.4 tagged version of dioxus-cli.

Additional Clarification (and potential bug??)

The base_path is currently defined as "name/app" without any trailing '/' character.

Assets are included in my program as:

rsx! {
  Link { rel: "stylesheet", href: asset!("/assets/css/main.css") }
}

(i.e. with leading '/' as mentioned in the alpha-4 notes).

If I navigate to http://127.0.0.1:8080/name/app the app appears, but without the css styling applied.
If I navigate to http://127.0.0.1:8080/name/app/ (with trailing "/") the app appears with styling appropriately applied.

@nigeleke nigeleke changed the title dx serve to serve http://127.0.0.1:8080/{base_path} dx serve should serve http://127.0.0.1:8080/{base_path} not just route Nov 4, 2024
@matthunz matthunz added bug Something isn't working web relating to the web renderer for dioxus labels Nov 11, 2024
@matthunz
Copy link
Contributor

Potentially related #2896

It looks like routes with trailing slashes are still treated as different paths in some cases 🤔

@nigeleke
Copy link
Author

nigeleke commented Dec 5, 2024

@jkelleyrtp / @ealmloff There may be two issues here; my main question was around the "serving at ..." when performing dioxus serve. I was expecting that to include the base path. I have retried here with dioxus 0.6.0-rc.0 (5bfdc03) and the issue still appears.

Screenshot From 2024-12-05 12-06-47

@mhfan
Copy link
Contributor

mhfan commented Feb 7, 2025

Any chance to make dx serve --platform desktop also work when base_path set in Dioxus.toml?

@ealmloff
Copy link
Member

ealmloff commented Feb 7, 2025

Any chance to make dx serve --platform desktop also work when base_path set in Dioxus.toml?

Yes, that should work. I opened an issue here: #3711

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working web relating to the web renderer for dioxus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants