use rocket::{get, routes, Route, State}; use sqlx::SqlitePool; use crate::{model::log::Log, rest::Config}; pub mod planned_event; pub mod user; #[get("/rss?")] async fn rss(db: &State, key: Option<&str>, config: &State) -> String { match key { Some(key) if key.eq(&config.rss_key) => 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 }