Skeleton for basic homepage and other generic pages like 404's and things
This commit is contained in:
parent
f6d2fcd3f6
commit
d709e5fcc5
6
service/src/generic.rs
Normal file
6
service/src/generic.rs
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
use rocket_dyn_templates::{context, Template};
|
||||||
|
|
||||||
|
#[get("/")]
|
||||||
|
pub fn homepage() -> Template {
|
||||||
|
Template::render("index", context!{ })
|
||||||
|
}
|
@ -4,6 +4,7 @@ use rocket::fs::FileServer;
|
|||||||
|
|
||||||
mod video;
|
mod video;
|
||||||
mod db;
|
mod db;
|
||||||
|
mod generic;
|
||||||
|
|
||||||
const FILES_VIDEO: &'static str = "/opt/clippable/file/video";
|
const FILES_VIDEO: &'static str = "/opt/clippable/file/video";
|
||||||
const DB_FILE: &'static str = "/opt/clippable/db.json";
|
const DB_FILE: &'static str = "/opt/clippable/db.json";
|
||||||
@ -14,6 +15,7 @@ const VIDEO_BASE_URI: &'static str = "/file/video";
|
|||||||
async fn main() {
|
async fn main() {
|
||||||
|
|
||||||
let _ = rocket::build()
|
let _ = rocket::build()
|
||||||
|
.mount("/", routes![generic::homepage])
|
||||||
.mount("/static", FileServer::from("static"))
|
.mount("/static", FileServer::from("static"))
|
||||||
.mount("/c", routes![video::index])
|
.mount("/c", routes![video::index])
|
||||||
.mount(VIDEO_BASE_URI, routes![video::file])
|
.mount(VIDEO_BASE_URI, routes![video::file])
|
||||||
|
Loading…
Reference in New Issue
Block a user