Get server address from dioxus-cli-config. (#3494)
This commit is contained in:
1 parent
273b70e9d6
commit
b348a725de
2 files changed
+15
-2
No files matched your search
@@ -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 }
|
||||
@@ -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"]
|
||||
@@ -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())
|
||||
|
||||
Reference in new issue
Block a user