frontend: use TRUNK_PUBLIC_URL
This commit is contained in:
parent
807ead7dc7
commit
4d8c4d502b
frontend
@ -5,6 +5,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Peazyweb - OpenVPN config creator</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<base data-trunk-public-url />
|
||||
</head>
|
||||
<body class="bg-gradient-to-r from-[#f0f9ff] to-[#e6f3ff]">
|
||||
<div id="app"></div>
|
||||
@ -13,4 +14,4 @@
|
||||
init();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
@ -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 {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user