Cors layer added

header, origin and method limitations
This commit is contained in:
2026-04-25 14:32:22 +02:00
parent 834a0b7aa4
commit 6c1c13e088
4 changed files with 41 additions and 3 deletions

View File

@@ -2,15 +2,18 @@
pub struct Env {
pub db_url: String,
pub token_secret: String,
pub origin: String
}
impl Env {
pub fn load() -> Env {
let db_url = std::env::var("DATABASE_URL").expect("DATABASE_URL must be set");
let token_secret = std::env::var("TOKEN_SECRET").expect("TOKEN_SECRET must be set");
let origin = std::env::var("ORIGIN").expect("ORIGIN must be set")
Env {
db_url,
token_secret,
origin
}
}
}