about summary refs log tree commit diff
path: root/web/atward/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'web/atward/src/main.rs')
-rw-r--r--web/atward/src/main.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/web/atward/src/main.rs b/web/atward/src/main.rs
index 49e23dde7b..44ab4d29c2 100644
--- a/web/atward/src/main.rs
+++ b/web/atward/src/main.rs
@@ -113,6 +113,14 @@ fn dispatch(handlers: &[Handler], query: &Query) -> Option<String> {
     None
 }
 
+/// Render the atward index page which gives users some information
+/// about how to use the service.
+fn index() -> Response {
+    Response::html(include_str!("index.html"))
+}
+
+/// Render the fallback page which informs users that their query is
+/// unsupported.
 fn fallback() -> Response {
     Response::text("error for emphasis that i am angery and the query whimchst i angery atward")
         .with_status_code(404)
@@ -127,7 +135,7 @@ fn main() {
         rouille::log(&request, std::io::stderr(), || {
             let query = match Query::from_request(&request) {
                 Some(q) => q,
-                None => return fallback(),
+                None => return index(),
             };
 
             match dispatch(&queries, &query) {