This commit is contained in:
2023-11-26 17:31:20 +01:00
parent d5a30b5951
commit e6fc26c1fc
6 changed files with 448 additions and 376 deletions

View File

@@ -1,14 +1,18 @@
use rocket::get;
use rocket::{get, State, config};
use rocket_dyn_templates::Template;
use serde::Serialize;
#[derive(Serialize, Debug)]
struct Test {
use crate::PresentationConfig;
#[derive(Serialize, Debug)]
struct RootPage {
static_host: String,
}
#[get("/")]
pub fn index() -> Template {
let context = Test {};
pub fn index(config: &State<PresentationConfig>) -> Template {
let context = RootPage {
static_host: config.static_route.clone(),
};
Template::render("default", &context)
}