refactor: streamline environment variable loading and improve logging

This commit is contained in:
MythEclipse
2025-07-31 15:07:18 +07:00
parent ee9d23e01b
commit 148cf3a5cd
19 changed files with 253 additions and 173 deletions
@@ -1,9 +1,9 @@
use axum::http::{HeaderValue, Method, header};
use imphnen_libs::Env;
use imphnen_libs::enviroment::ENV;
use tower_http::cors::CorsLayer;
pub fn cors_middleware() -> CorsLayer {
let env = Env::new();
let env = &ENV;
let cors_origins = match env.rust_env.as_str() {
"development" => vec!["http://localhost:3000"],
"production" => {