first commit
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
use dotenvy::dotenv;
|
||||
|
||||
pub struct EnvConfig {
|
||||
pub http_port: u16,
|
||||
pub bot_name: String,
|
||||
}
|
||||
|
||||
pub fn load_config() -> anyhow::Result<EnvConfig> {
|
||||
dotenv().ok();
|
||||
|
||||
let http_port = std::env::var("HTTP_PORT")?.parse()?;
|
||||
|
||||
let bot_name = std::env::var("BOT_NAME")?;
|
||||
|
||||
Ok(EnvConfig {
|
||||
http_port,
|
||||
bot_name,
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user