Use the index Tera template for the index GET route

This commit is contained in:
Paul van Tilburg 2017-12-17 13:22:01 +01:00
parent 41b15ffdf7
commit 5dc71e82d3
1 changed files with 5 additions and 2 deletions

View File

@ -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 {