You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
fast-insiders/client/src/env.rs

18 lines
353 B

use serde::{Deserialize, Serialize};
// use std::env;
#[derive(Clone, Serialize, Deserialize)]
pub struct Config {
pub api_url: String,
}
#[cfg(engine)]
impl Config {
pub fn new() -> Self {
let api_url =
std::env::var("API_URL").expect("The environment variable API_URL should be set");
Config { api_url }
}
}