Skip to content

Commit

Permalink
Get server address from dioxus-cli-config. (#3494)
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-r-earp authored Jan 7, 2025
1 parent 273b70e commit b348a72
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion examples/fullstack-auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ publish = false
dioxus-web = { workspace = true, features = ["hydrate"], optional = true }
dioxus = { features = ["fullstack"], workspace = true }
dioxus-fullstack = { workspace = true }
dioxus-cli-config = { workspace = true, optional = true }
axum = { workspace = true, optional = true }
tokio = { workspace = true, features = ["full"], optional = true }
tower-http = { workspace = true, features = ["auth"], optional = true }
Expand Down Expand Up @@ -43,5 +44,17 @@ optional = true

[features]
default = []
server = ["axum", "tokio", "dioxus-fullstack/axum", "tower-http", "async-trait", "sqlx", "axum_session", "axum_session_auth", "http", "tower"]
server = [
"dioxus-cli-config",
"axum",
"tokio",
"dioxus-fullstack/axum",
"tower-http",
"async-trait",
"sqlx",
"axum_session",
"axum_session_auth",
"http",
"tower",
]
web = ["dioxus-web"]
2 changes: 1 addition & 1 deletion examples/fullstack-auth/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn main() {
.layer(axum_session::SessionLayer::new(session_store));

// run it
let addr = std::net::SocketAddr::from(([127, 0, 0, 1], 3000));
let addr = dioxus_cli_config::fullstack_address_or_localhost();
let listener = tokio::net::TcpListener::bind(&addr).await.unwrap();

axum::serve(listener, app.into_make_service())
Expand Down

0 comments on commit b348a72

Please sign in to comment.