use rocket::{get, routes, Route, State}; use sqlx::SqlitePool; use crate::model::log::Log; pub mod planned_event; pub mod user; #[get("/rss?")] async fn rss(db: &State, key: Option<&str>) -> String { match key { Some(key) if key.eq("G9h/f2MFEr408IaB4Yd67/maVSsnAJNjcaZ2Tzl5Vo=") => { Log::generate_feed(db).await } _ => "Not allowed".to_string(), } } pub fn routes() -> Vec { let mut ret = Vec::new(); ret.append(&mut user::routes()); ret.append(&mut planned_event::routes()); ret.append(&mut routes![rss]); ret }