forked from Ruderverein-Donau-Linz/rowt
26 lines
606 B
Rust
26 lines
606 B
Rust
use rocket::{get, routes, Route, State};
|
|
use sqlx::SqlitePool;
|
|
|
|
use crate::model::log::Log;
|
|
|
|
pub mod planned_event;
|
|
pub mod user;
|
|
|
|
#[get("/rss?<key>")]
|
|
async fn rss(db: &State<SqlitePool>, 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<Route> {
|
|
let mut ret = Vec::new();
|
|
ret.append(&mut user::routes());
|
|
ret.append(&mut planned_event::routes());
|
|
ret.append(&mut routes![rss]);
|
|
ret
|
|
}
|