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