diff --git a/examples/counter_isomorphic/src/main.rs b/examples/counter_isomorphic/src/main.rs index 8634210920..0e66040ee0 100644 --- a/examples/counter_isomorphic/src/main.rs +++ b/examples/counter_isomorphic/src/main.rs @@ -37,7 +37,7 @@ cfg_if! { // when not using cargo-leptos None must be replaced with Some("Cargo.toml") let conf = get_configuration(None).await.unwrap(); - let addr = conf.leptos_options.site_address.clone(); + let addr = conf.leptos_options.site_addr.clone(); let routes = generate_route_list(|cx| view! { cx, }); HttpServer::new(move || { diff --git a/examples/errors_axum/src/main.rs b/examples/errors_axum/src/main.rs index 44efb4d2a2..0d315e8381 100644 --- a/examples/errors_axum/src/main.rs +++ b/examples/errors_axum/src/main.rs @@ -44,7 +44,7 @@ async fn main() { // Setting this to None means we'll be using cargo-leptos and its env vars let conf = get_configuration(None).await.unwrap(); let leptos_options = conf.leptos_options; - let addr = leptos_options.site_address; + let addr = leptos_options.site_addr; let routes = generate_route_list(|cx| view! { cx, }).await; // build our application with a route diff --git a/examples/hackernews/src/main.rs b/examples/hackernews/src/main.rs index 952339733e..9ce0d9fc05 100644 --- a/examples/hackernews/src/main.rs +++ b/examples/hackernews/src/main.rs @@ -24,7 +24,7 @@ cfg_if! { // Setting this to None means we'll be using cargo-leptos and its env vars. let conf = get_configuration(None).await.unwrap(); - let addr = conf.leptos_options.site_address.clone(); + let addr = conf.leptos_options.site_addr.clone(); // Generate the list of routes in your Leptos App let routes = generate_route_list(|cx| view! { cx, }); diff --git a/examples/hackernews_axum/src/main.rs b/examples/hackernews_axum/src/main.rs index fa2f06a36a..977db345f3 100644 --- a/examples/hackernews_axum/src/main.rs +++ b/examples/hackernews_axum/src/main.rs @@ -19,7 +19,7 @@ if #[cfg(feature = "ssr")] { let conf = get_configuration(Some("Cargo.toml")).await.unwrap(); let leptos_options = conf.leptos_options; - let addr = leptos_options.site_address.clone(); + let addr = leptos_options.site_addr.clone(); let routes = generate_route_list(|cx| view! { cx, }).await; simple_logger::init_with_level(log::Level::Debug).expect("couldn't initialize logging"); diff --git a/examples/tailwind/src/main.rs b/examples/tailwind/src/main.rs index 39fd595f36..e6c35f28d7 100644 --- a/examples/tailwind/src/main.rs +++ b/examples/tailwind/src/main.rs @@ -20,7 +20,7 @@ cfg_if! { // Setting this to None means we'll be using cargo-leptos and its env vars. let conf = get_configuration(None).await.unwrap(); - let addr = conf.leptos_options.site_address.clone(); + let addr = conf.leptos_options.site_addr.clone(); // Generate the list of routes in your Leptos App let routes = generate_route_list(|cx| view! { cx, }); diff --git a/examples/todo_app_sqlite/src/main.rs b/examples/todo_app_sqlite/src/main.rs index 2e39a7ce3e..ffcdc75796 100644 --- a/examples/todo_app_sqlite/src/main.rs +++ b/examples/todo_app_sqlite/src/main.rs @@ -29,7 +29,7 @@ cfg_if! { // Setting this to None means we'll be using cargo-leptos and its env vars. let conf = get_configuration(None).await.unwrap(); - let addr = conf.leptos_options.site_address.clone(); + let addr = conf.leptos_options.site_addr.clone(); // Generate the list of routes in your Leptos App let routes = generate_route_list(|cx| view! { cx, }); diff --git a/examples/todo_app_sqlite_axum/src/main.rs b/examples/todo_app_sqlite_axum/src/main.rs index 0578c5d6c7..970b7a44f8 100644 --- a/examples/todo_app_sqlite_axum/src/main.rs +++ b/examples/todo_app_sqlite_axum/src/main.rs @@ -43,7 +43,7 @@ if #[cfg(feature = "ssr")] { // Setting this to None means we'll be using cargo-leptos and its env vars let conf = get_configuration(None).await.unwrap(); let leptos_options = conf.leptos_options; - let addr = leptos_options.site_address; + let addr = leptos_options.site_addr; let routes = generate_route_list(|cx| view! { cx, }).await; // build our application with a route diff --git a/integrations/actix/src/lib.rs b/integrations/actix/src/lib.rs index d1811dc6fd..594f8a23b0 100644 --- a/integrations/actix/src/lib.rs +++ b/integrations/actix/src/lib.rs @@ -269,7 +269,7 @@ pub fn handle_server_fns_with_context( /// #[actix_web::main] /// async fn main() -> std::io::Result<()> { /// let conf = get_configuration(Some("Cargo.toml")).await.unwrap(); -/// let addr = conf.leptos_options.site_address.clone(); +/// let addr = conf.leptos_options.site_addr.clone(); /// HttpServer::new(move || { /// let leptos_options = &conf.leptos_options; /// @@ -367,7 +367,7 @@ where /// #[actix_web::main] /// async fn main() -> std::io::Result<()> { /// let conf = get_configuration(Some("Cargo.toml")).await.unwrap(); -/// let addr = conf.leptos_options.site_address.clone(); +/// let addr = conf.leptos_options.site_addr.clone(); /// HttpServer::new(move || { /// let leptos_options = &conf.leptos_options; /// @@ -528,7 +528,7 @@ fn html_parts(options: &LeptosOptions, meta_context: Option<&MetaContext>) -> (S wasm_output_name.push_str("_bg"); } - let site_ip = &options.site_address.ip().to_string(); + let site_ip = &options.site_addr.ip().to_string(); let reload_port = options.reload_port; let pkg_path = &options.site_pkg_dir; diff --git a/integrations/axum/src/lib.rs b/integrations/axum/src/lib.rs index c14b6f75a9..9e0e4c794e 100644 --- a/integrations/axum/src/lib.rs +++ b/integrations/axum/src/lib.rs @@ -327,7 +327,7 @@ pub type PinnedHtmlStream = Pin> + Send> /// /// let conf = get_configuration(Some("Cargo.toml")).await.unwrap(); /// let leptos_options = conf.leptos_options; -/// let addr = leptos_options.site_address.clone(); +/// let addr = leptos_options.site_addr.clone(); /// /// // build our application with a route /// let app = Router::new() @@ -537,7 +537,7 @@ fn html_parts(options: &LeptosOptions, meta: Option<&MetaContext>) -> (String, & wasm_output_name.push_str("_bg"); } - let site_ip = &options.site_address.ip().to_string(); + let site_ip = &options.site_addr.ip().to_string(); let reload_port = options.reload_port; let leptos_autoreload = match std::env::var("LEPTOS_WATCH").is_ok() { diff --git a/leptos_config/src/lib.rs b/leptos_config/src/lib.rs index d593486dbf..fbe79c2362 100644 --- a/leptos_config/src/lib.rs +++ b/leptos_config/src/lib.rs @@ -43,7 +43,7 @@ pub struct LeptosOptions { /// Using an env variable here would allow you to run the same code in dev and prod /// Defaults to `127.0.0.1:3000` #[builder(setter(into), default=SocketAddr::from(([127,0,0,1], 3000)))] - pub site_address: SocketAddr, + pub site_addr: SocketAddr, /// The port the Websocket watcher listens on. Should match the `reload_port` in cargo-leptos(if using). /// Defaults to `3001` #[builder(default = 3001)] @@ -58,7 +58,7 @@ impl LeptosOptions { site_root: env_w_default("LEPTOS_SITE_ROOT", "target/site")?, site_pkg_dir: env_w_default("LEPTOS_SITE_PKG_DIR", "pkg")?, env: Env::default(), - site_address: env_w_default("LEPTOS_SITE_ADDR", "127.0.0.1:3000")?.parse()?, + site_addr: env_w_default("LEPTOS_SITE_ADDR", "127.0.0.1:3000")?.parse()?, reload_port: env_w_default("LEPTOS_RELOAD_PORT", "3001")?.parse()?, }) }