use rocket::http::{ContentType, Status}; use rocket::request::Request; use rocket::response::{content, Responder, Response}; pub struct Svg(pub R); impl<'r, R: Responder<'r>> Responder<'r> for Svg { fn respond_to(self, req: &Request) -> Result, Status> { content::Content(ContentType::SVG, self.0).respond_to(req) } } #[get("/")] pub fn index() -> content::Html<&'static str> { content::Html(include_str!("static/index.html")) } #[get("/checkmark.svg")] pub fn checkmark() -> Svg<&'static str> { Svg(include_str!("static/checkmark.svg")) } #[get("/cross.svg")] pub fn cross() -> Svg<&'static str> { Svg(include_str!("static/cross.svg")) } #[get("/hourglass.svg")] pub fn hourglass() -> Svg<&'static str> { Svg(include_str!("static/hourglass.svg")) } #[get("/legal.html")] pub fn legal() -> content::Html<&'static str> { content::Html(include_str!("static/legal.html")) } #[get("/webldappasswd.css")] pub fn css() -> content::Css<&'static str> { content::Css(include_str!("static/webldappasswd.css")) } #[get("/webldappasswd.js")] pub fn js() -> content::JavaScript<&'static str> { content::JavaScript(include_str!("static/webldappasswd.js")) }