Initial commit
This commit is contained in:
13
src/lib.rs
Normal file
13
src/lib.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
use rocket::*;
|
||||
use rocket_dyn_templates::Template;
|
||||
|
||||
pub mod routes;
|
||||
|
||||
pub fn rocket_builder() -> Rocket<Build> {
|
||||
rocket::build().attach(
|
||||
Template::fairing()
|
||||
).mount("/", routes![
|
||||
routes::root::index
|
||||
])
|
||||
}
|
||||
8
src/main.rs
Normal file
8
src/main.rs
Normal file
@@ -0,0 +1,8 @@
|
||||
use ovlach_frontend::rocket_builder;
|
||||
use rocket::launch;
|
||||
|
||||
|
||||
#[launch]
|
||||
fn rocket() -> _ {
|
||||
rocket_builder()
|
||||
}
|
||||
1
src/routes/mod.rs
Normal file
1
src/routes/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod root;
|
||||
14
src/routes/root.rs
Normal file
14
src/routes/root.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use rocket::get;
|
||||
use rocket_dyn_templates::Template;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
struct Test {
|
||||
|
||||
}
|
||||
|
||||
#[get("/")]
|
||||
pub fn index() -> Template {
|
||||
let context = Test {};
|
||||
Template::render("default", &context)
|
||||
}
|
||||
Reference in New Issue
Block a user