diff --git a/service/src/generic.rs b/service/src/generic.rs new file mode 100644 index 0000000..1b4fd56 --- /dev/null +++ b/service/src/generic.rs @@ -0,0 +1,6 @@ +use rocket_dyn_templates::{context, Template}; + +#[get("/")] +pub fn homepage() -> Template { + Template::render("index", context!{ }) +} \ No newline at end of file diff --git a/service/src/main.rs b/service/src/main.rs index 0e493e2..416efec 100644 --- a/service/src/main.rs +++ b/service/src/main.rs @@ -4,6 +4,7 @@ use rocket::fs::FileServer; mod video; mod db; +mod generic; const FILES_VIDEO: &'static str = "/opt/clippable/file/video"; const DB_FILE: &'static str = "/opt/clippable/db.json"; @@ -14,6 +15,7 @@ const VIDEO_BASE_URI: &'static str = "/file/video"; async fn main() { let _ = rocket::build() + .mount("/", routes![generic::homepage]) .mount("/static", FileServer::from("static")) .mount("/c", routes![video::index]) .mount(VIDEO_BASE_URI, routes![video::file])