From 23871d5aadcaa4d01b7c46cb951854572940414d Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 2 Oct 2025 19:14:17 +0200 Subject: Rewrite --- src/main.rs | 67 ------------------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 src/main.rs (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index b380491..0000000 --- a/src/main.rs +++ /dev/null @@ -1,67 +0,0 @@ -/* - 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 -*/ -#![feature(const_trait_impl)] -pub mod blog; -pub mod error; -pub mod layout; -pub mod pages; -pub mod projects; -pub mod source; -pub mod wellknown; - -use blog::*; -use error::*; -use pages::*; -use projects::*; -use rocket::{catchers, fairing::AdHoc, fs::FileServer, http::Header, routes}; -use source::*; -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 {}) - })) - .manage(prepare_source()) - .mount("/blog/assets", FileServer::from(ASSET_ROOT)) - .mount( - "/", - routes![ - r_root, - r_about, - r_contact, - r_projects, - r_pgp_key, - r_source, - r_blog, - r_stuff, - r_hello, - r_favicon, - r_blog_index, - r_blog_article, - r_blog_atom, - r_style, - r_wellknown_security, - r_wellknown_matrix_server, - r_wellknown_matrix_client, - r_wellknown_flathub_verified, - ], - ) - .register("/", catchers![r_catch]) - .launch() - .await - .unwrap(); -} - -#[macro_export] -macro_rules! uri { - ($kk:stmt) => { - &rocket::uri!($kk).to_string() - }; -} -- cgit v1.2.3-70-g09d2