diff --git a/src/views.rs b/src/views.rs index f343552..f21b1e6 100644 --- a/src/views.rs +++ b/src/views.rs @@ -12,15 +12,15 @@ use crate::language::Language; use crate::FRONTEND_DIR; #[get("/")] -pub fn frontend() -> content::Html { +pub fn frontend() -> content::RawHtml { match fs::read_to_string(&format!("{}/{}", FRONTEND_DIR, "index.html")) { - Ok(file) => content::Html(file), - Err(_) => content::Html(String::from("

No web frontend installed.

")) + Ok(file) => content::RawHtml(file), + Err(_) => content::RawHtml(String::from("

No web frontend installed.

")) } } #[get("/langs//words/")] -pub fn get_entries(db: &State, lang: &str, word: &str) -> status::Custom> { +pub fn get_entries(db: &State, lang: &str, word: &str) -> status::Custom> { let conn = db.connect(); let mut statement = conn.prepare(&format!( @@ -46,7 +46,7 @@ pub fn get_entries(db: &State, lang: &str, word: &str) -> status::Custom } words.push(']'); - status::Custom(Status::Ok, content::Json(words)) + status::Custom(Status::Ok, content::RawJson(words)) } #[get("/langs//words?&&")]