2022-11-12 00:41:51 +01:00
|
|
|
mod config;
|
|
|
|
mod msg;
|
|
|
|
mod notification;
|
|
|
|
mod pages;
|
|
|
|
|
2023-01-25 08:56:14 +01:00
|
|
|
use tokio::sync::Mutex;
|
2022-11-22 14:36:12 +01:00
|
|
|
|
2023-01-28 07:24:50 +01:00
|
|
|
use actix_web::{web, App, HttpServer};
|
2022-11-12 00:41:51 +01:00
|
|
|
|
|
|
|
#[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();
|
2023-09-14 17:42:06 +02:00
|
|
|
web_base::bootstrap::cache_bootstrap().await;
|
2022-11-12 00:41:51 +01:00
|
|
|
|
2023-09-14 17:42:06 +02:00
|
|
|
web_base::map!(web_base::Site::new().enable_bootstrap(true), |x: App<_>| {
|
|
|
|
x.app_data(web::Data::new(conf.clone()))
|
2022-11-12 00:41:51 +01:00
|
|
|
.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)
|
2023-09-14 17:42:06 +02:00
|
|
|
.service(pages::index::message_post)
|
2022-11-12 00:41:51 +01:00
|
|
|
})
|
|
|
|
.bind(("0.0.0.0", 8080))?
|
|
|
|
.run()
|
|
|
|
.await
|
|
|
|
}
|