/* This file is part of metamuffins website (https://codeberg.org/metamuffin/website) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2023 metamuffin */ pub mod layout; pub mod pages; pub mod wellknown; use pages::*; use rocket::{catchers, fairing::AdHoc, http::Header, routes}; use wellknown::*; #[tokio::main] async fn main() { env_logger::init_from_env("LOG"); let _ = rocket::build() .attach(AdHoc::on_response("set server header", |_req, res| { res.set_header(Header::new("server", "blub")); Box::pin(async {}) })) .mount( "/", routes![ r_root, r_about, r_contact, r_projects, r_pgp_key, r_wellknown_security, r_wellknown_matrix_server, r_wellknown_matrix_client, ], ) // .mount("/", FileServer::from("modules")) .register("/", catchers![r_catch]) .launch() .await .unwrap(); } #[macro_export] macro_rules! uri { ($kk:stmt) => { &rocket::uri!($kk).to_string() }; }