1
This commit is contained in:
@@ -32,9 +32,17 @@ struct Inner {
|
||||
pub struct AppConfig {
|
||||
inner: Arc<RwLock<Inner>>,
|
||||
}
|
||||
|
||||
fn is_dev() -> bool {
|
||||
cfg!(debug_assertions)
|
||||
}
|
||||
pub fn api_base() -> String {
|
||||
std::env::var("AICLIENT_API_BASE").unwrap_or_else(|_| "http://127.0.0.1:8001".to_string())
|
||||
std::env::var("AICLIENT_API_BASE").unwrap_or_else(|_| {
|
||||
if is_dev() {
|
||||
"http://127.0.0.1:8001".to_string()
|
||||
} else {
|
||||
"http://81.71.163.140:8001".to_string()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/// 将库表 `name` 转为 Node 环境变量名(不含前缀),如 `llm.api_key` → `LLM_API_KEY`。
|
||||
|
||||
Reference in New Issue
Block a user