refactor: streamline environment variable loading and improve logging

This commit is contained in:
MythEclipse committed 2025-07-31 15:07:18 +07:00
1 parent ee9d23e01b
commit 148cf3a5cd
19 files changed
+253 -173

No files matched your search

@@ -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" => {