Comments (2)
Thank you for the feedback!
I can confirm, from referencing the axum-router example, and the Dioxus fullstack config source code, I was able to create this snippet:
let cfg = server_only!(
dioxus::fullstack::Config::new().addr(std::net::SocketAddr::from(([0, 0, 0, 0], 8234)))
);
LaunchBuilder::fullstack()
.with_cfg(cfg)
.launch(info_app::DioxusApp);
This will result in a built binary that will listen on 0.0.0.0:8234
, which resolves the issue.
I would request that there be more consistent documentation on this, if possible. It's at the best slightly confusing to imply that fullstack's listen parameters can be changed with a --port
flag. There does not seem to be any mention of how to do this, so without knowing where to look, and what to look for, it would be reasonable to assume someone in a similar position may just assume it isn't possible altogether.
Fullstack builds a separate server binary that renders the app on the server and serves static files. That server uses a default port of 8080 that can be changed in the fullstack config.
At the very least, it would be good to mention this somewhere, and possibly take code snippets from the examples to show how you would change it.
If you are interested in working on this issue, we could introduce a new struct in the cli-config library that has runtime settings for dioxus like --port. When we run the CLI, we could set the environment variable like DIOXUS_ARGUMENTS and then read it inside the fullstack server to provide a better default port value
I have no problem with taking a look at this myself, but I am going to be a little busy the next week or so. I think that one of two (or both) solutions would be the best option moving forward with this:
- Make it clear where an
addr
and/orport
value could be added to an existingDioxus.toml
to be forwarded to a compiled binary in fullstack - Add a cli flag as you suggested that would do the same
Both approaches I think have decent merit, and achieve the same goal.
from dioxus.
Fullstack builds a separate server binary that renders the app on the server and serves static files. That server uses a default port of 8080
that can be changed in the fullstack config.
The dioxus-cli currently only forwards information in the dioxus.toml
config to applications with the DIOXUS_CONFIG
environment variable (here). We need to also forward some CLI args like --port
If you are interested in working on this issue, we could introduce a new struct in the cli-config
library that has runtime settings for dioxus like --port
. When we run the CLI, we could set the environment variable like DIOXUS_ARGUMENTS
and then read it inside the fullstack server to provide a better default port value
from dioxus.
Related Issues (20)
- [Desktop] Asset inclusion not working HOT 3
- `use_effect` not running when writing to signal asynchronously HOT 1
- dx new in existing multicrate workspace HOT 1
- `dx build --release` doesn't read the `[profile.release]` table from `Cargo.toml` (`strip` doesn't work) HOT 10
- Route order matters between url string and enum fields
- Add ability to configure "always on/pin to top" option for the Dioxus Desktop HOT 3
- Dynamic rendering unresponsive for if-else-expressions where expressions are Fragments
- Shorthand notation breaking rsx! macro with conditional rendering
- `rustflags` in `./cargo/config.toml` being ignored HOT 2
- use_callback should take a closure that accepts an argument HOT 1
- Call `.into()` automatically for the default value when deriving `Props`
- use of unstable library feature 'proc_macro_byte_character' HOT 1
- Dioxus CLI MSRV
- live reload doesn't work when just modifying the css file HOT 2
- Ctrl/cmd click does not open in a new tab/window
- Dioxus-cli ignores env variables in `.cargo/config.toml` HOT 2
- pointermove events on Windows crash with InvalidType HOT 3
- [Desktop] Hot reloading does not work in the "tailwind" sample
- question: custom rendering to arbitrary wayland surface HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dioxus.