Trading card city builder game?

configurable server url

+4 -3
+1
.env.example
··· 3 3 ROOT_DATABASE_URL="postgres://postgres:postgres@localhost:5432/postgres" 4 4 5 5 WEBSOCKET_PROTOCOLS="json" 6 + SERVER_URL="http://localhost:8080" 6 7 7 8 PUBLIC_ENV=localhost 8 9
+1 -1
src/app/play.rs
··· 3 3 4 4 #[component] 5 5 pub fn Play() -> Element { 6 - let socket = use_custom_websocket("api/ws"); 6 + let socket = use_custom_websocket("play/ws"); 7 7 8 8 use_future(move || async move { 9 9 while let Ok(msg) = socket.recv().await {
+2 -2
src/main.rs
··· 6 6 7 7 fn main() { 8 8 #[cfg(not(feature = "server"))] 9 - dioxus::fullstack::set_server_url("http://localhost:8080"); 9 + dioxus::fullstack::set_server_url(env!("SERVER_URL")); 10 10 11 11 #[cfg(not(feature = "server"))] 12 12 dioxus::launch(App); ··· 22 22 .await?; 23 23 24 24 let router = dioxus::server::router(App) 25 - .route("/api/ws", axum::routing::any(api::ws::v1)) 25 + .route("/play/ws", axum::routing::any(api::ws::v1)) 26 26 .layer(Extension(pool)); 27 27 Ok(router) 28 28 });