Updated UI with accounts and fixed routing
This commit is contained in:
@@ -59,20 +59,26 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
}
|
||||
}
|
||||
|
||||
let certificate_path = env::var("SSL_CA_PATH")?;
|
||||
let certificate_data = std::fs::read(certificate_path)?;
|
||||
let certificate = Certificate::from_pem(&certificate_data)?;
|
||||
|
||||
let client = reqwest::Client::builder()
|
||||
let mut client_builder = reqwest::Client::builder()
|
||||
.timeout(Duration::from_secs(10))
|
||||
.add_root_certificate(certificate)
|
||||
.tls_built_in_root_certs(true)
|
||||
.tls_built_in_root_certs(true);
|
||||
|
||||
if let Ok(val) = env::var("NGINX_SSL_ENABLED") {
|
||||
if val == "true" {
|
||||
let certificate_path = env::var("SSL_CA_PATH")?;
|
||||
let certificate_data = std::fs::read(certificate_path)?;
|
||||
let certificate = Certificate::from_pem(&certificate_data)?;
|
||||
client_builder = client_builder.add_root_certificate(certificate);
|
||||
}
|
||||
}
|
||||
|
||||
let client = client_builder
|
||||
.build()
|
||||
.expect("Failed to create reqwest client");
|
||||
|
||||
let state = AppState { client };
|
||||
let host = "0.0.0.0";
|
||||
let port = "5000";
|
||||
let port = env::var("API_PORT").unwrap_or("5000".to_string());
|
||||
|
||||
let server = match HttpServer::new(move || {
|
||||
let cors = Cors::default()
|
||||
|
||||
Reference in New Issue
Block a user