bfile/filed/src/main.rs

29 lines
582 B
Rust
Raw Normal View History

2023-09-29 12:15:07 +02:00
#![forbid(unsafe_code)]
#![warn(clippy::suspicious)]
#![warn(clippy::correctness)]
2023-10-01 06:17:58 +02:00
mod files;
2023-09-29 12:15:07 +02:00
mod env;
mod web;
2023-10-01 02:14:35 +02:00
mod db;
2023-09-29 12:15:07 +02:00
#[tokio::main]
async fn main() {
dotenvy::dotenv().unwrap();
let envy = env::loadenv().unwrap();
// set up logging
if envy.logging {
#[cfg(debug_assertions)] {
femme::with_level(femme::LevelFilter::Debug)
}
#[cfg(not(debug_assertions))] {
femme::with_level(femme::LevelFilter::Info)
}
} else {
femme::with_level(femme::LevelFilter::Off);
}
2023-09-29 12:57:53 +02:00
web::serve(envy).await;
2023-09-29 12:15:07 +02:00
}