diff --git a/src/main.rs b/src/main.rs index cc1d00c..1599d95 100644 --- a/src/main.rs +++ b/src/main.rs @@ -74,6 +74,22 @@ async fn html( Ok(content::RawHtml(html)) } +// this will probably never be used but it was a neat simple thing for me to +// implement to show that i know what im doing with this language. im good at +// this programming stuff i promise +#[rocket::get("/html_full?")] +async fn html_full( + page: &str, + pool: &rocket::State, +) -> Result, String> { + html(page, pool).await.map(|html| { + content::RawHtml(format!( + "{}", + html.0 + )) + }) +} + #[rocket::get("/add?&&")] async fn add( page: &str, @@ -102,5 +118,5 @@ async fn rocket() -> _ { .expect("Failed to connect to database"); rocket::build() .manage(pool) - .mount("/", rocket::routes![txt, html, add]) + .mount("/", rocket::routes![txt, html, html_full, add]) }