diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/modelthing-webface.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bin/modelthing-webface.rs b/src/bin/modelthing-webface.rs index 5dc98f8..0940ea0 100644 --- a/src/bin/modelthing-webface.rs +++ b/src/bin/modelthing-webface.rs @@ -13,10 +13,11 @@ fn home(r: &mut Request) -> PencilResult { return r.app.render_template("home.html", &context); } -fn about(_: &mut Request) -> PencilResult { - let mut response = Response::from(include_str!("../../README.txt")); - response.set_content_type("text/plain"); - Ok(response) +fn readme(r: &mut Request) -> PencilResult { + let mut context = BTreeMap::new(); + let raw_text = include_str!("../../README.txt"); + context.insert("raw_text".to_string(), raw_text.to_string()); + return r.app.render_template("raw.html", &context); } fn model_list(_: &mut Request) -> PencilResult { @@ -57,8 +58,9 @@ fn main() { app.register_template("base.html"); app.register_template("home.html"); + app.register_template("raw.html"); app.get("/", "home", home); - app.get("/about/", "about", about); + app.get("/readme/", "readme", readme); app.get("/model_list/", "model_list", model_list); app.register_template("model_view.html"); app.get("/model/<model_id:string>", "model", model_view); |