mod config; mod msg; mod notification; mod pages; use tokio::sync::Mutex; use actix_web::{web, App, HttpServer}; #[actix_web::main] async fn main() -> std::io::Result<()> { std::env::set_var("RUST_LOG", "info"); std::env::set_var("RUST_BACKTRACE", "1"); env_logger::init(); let conf = config::Config::new(); web_base::bootstrap::cache_bootstrap().await; web_base::map!(web_base::Site::new().enable_bootstrap(true), |x: App<_>| { x.app_data(web::Data::new(conf.clone())) .service(pages::index::index) // Assets .service(pages::assets::wallpaper) .service(pages::assets::me_img) .service(pages::index::public_key) .service(pages::index::mirrors) .service(pages::index::message_page) .service(pages::index::message_post) }) .bind(("0.0.0.0", 8080))? .run() .await }