Use the index Tera template for the index GET route
This commit is contained in:
parent
41b15ffdf7
commit
5dc71e82d3
|
@ -10,12 +10,15 @@ extern crate rocket_contrib;
|
|||
use rocket::Rocket;
|
||||
use rocket_contrib::Template;
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
mod list;
|
||||
mod static_files;
|
||||
|
||||
#[get("/")]
|
||||
fn index() -> &'static str {
|
||||
"Hello, world!"
|
||||
fn index() -> Template {
|
||||
let context: HashMap<String, String> = HashMap::new();
|
||||
Template::render("index", &context)
|
||||
}
|
||||
|
||||
fn rocket() -> Rocket {
|
||||
|
|
Loading…
Reference in New Issue