bff-challenge/src/main.rs

30 lines
509 B
Rust
Raw Normal View History

2023-01-24 18:37:35 +00:00
#![feature(decl_macro)]
use rocket::*;
use rocket_dyn_templates::{Template, context};
#[get("/create")]
2023-01-25 18:16:31 +00:00
fn create() -> Template
2023-01-24 18:37:35 +00:00
{
2023-01-25 18:16:31 +00:00
Template::render("create", context!{})
2023-01-24 18:37:35 +00:00
}
#[get("/about")]
fn about() -> Template
{
Template::render("about", context!{})
}
#[get("/")]
fn index() -> Template
{
Template::render("index", context! {
create_uri: uri!(create())
})
}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/", routes![create, index, about]).attach(Template::fairing())
}