env-defined URL for site
This commit is contained in:
parent
0bd54a517d
commit
6f0a7bf9f4
|
|
@ -39,12 +39,7 @@ pub enum ConnectionError {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn url() -> String {
|
fn url() -> String {
|
||||||
format!(
|
format!("{}/connect/client", crate::clients::BASE_URL)
|
||||||
"{}client",
|
|
||||||
option_env!("LOCAL")
|
|
||||||
.map(|_| crate::clients::DEBUG_URL)
|
|
||||||
.unwrap_or(crate::clients::LIVE_URL)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
|
||||||
|
|
@ -54,12 +54,7 @@ use crate::{
|
||||||
use crate::WerewolfError;
|
use crate::WerewolfError;
|
||||||
|
|
||||||
fn url() -> String {
|
fn url() -> String {
|
||||||
format!(
|
format!("{}/connect/host", crate::clients::BASE_URL)
|
||||||
"{}host",
|
|
||||||
option_env!("LOCAL")
|
|
||||||
.map(|_| crate::clients::DEBUG_URL)
|
|
||||||
.unwrap_or(crate::clients::LIVE_URL)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn connect_ws() -> WebSocket {
|
async fn connect_ws() -> WebSocket {
|
||||||
|
|
|
||||||
|
|
@ -22,5 +22,7 @@ pub mod host {
|
||||||
pub use host::*;
|
pub use host::*;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEBUG_URL: &str = "ws://192.168.1.162:8080/connect/";
|
const BASE_URL: &str = match option_env!("BASE_URL") {
|
||||||
const LIVE_URL: &str = "wss://wolf.emilis.dev/connect/";
|
Some(base_url) => base_url,
|
||||||
|
None => "ws://192.168.1.162:8080",
|
||||||
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue