frontend: use TRUNK_PUBLIC_URL
This commit is contained in:
@@ -37,8 +37,15 @@ pub enum Route {
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
static ref API_BASE_URL: String =
|
||||
std::env::var("API_BASE_URL").unwrap_or("http://127.0.0.1:8000/api/v1".into());
|
||||
static ref API_BASE_URL: String = option_env!("API_BASE_URL")
|
||||
.unwrap_or(
|
||||
(option_env!("TRUNK_PUBLIC_URL")
|
||||
.unwrap_or("http://127.0.0.1:8000/")
|
||||
.to_string()
|
||||
+ "api/v1")
|
||||
.as_str(),
|
||||
)
|
||||
.to_owned();
|
||||
}
|
||||
|
||||
pub struct APIEndpoints {}
|
||||
|
||||
Reference in New Issue
Block a user