feat: use env var for ollama url
CI / Rust CI (push) Successful in 1m11s
Publish & Deploy / Build and Push to Registry (push) Successful in 17s
Publish & Deploy / Deploy via SSH (push) Successful in 18s

This commit is contained in:
2026-04-09 21:17:29 +02:00
parent 46e455fa07
commit fa09e75a09
+5 -1
View File
@@ -7,9 +7,13 @@ use crate::providers::ollama::OllamaProvider;
use crate::state::app_state::AppState; use crate::state::app_state::AppState;
use axum::Router; use axum::Router;
use once_cell::sync::Lazy;
use std::env;
use std::net::SocketAddr; use std::net::SocketAddr;
use std::sync::Arc; use std::sync::Arc;
static OLLAMA_URL: Lazy<String> = Lazy::new(|| env::var("OLLAMA_URL").expect("OLLAMA_URL not set"));
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
@@ -18,7 +22,7 @@ async fn main() {
} }
let state = AppState { let state = AppState {
ollama: Arc::new(OllamaProvider::new("http://localhost:11434")), ollama: Arc::new(OllamaProvider::new(OLLAMA_URL.as_str())),
}; };
let app = Router::new() let app = Router::new()