pytron-web/src/main.rs

23 lines
452 B
Rust
Raw Normal View History

2019-03-16 11:04:06 +01:00
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
use rocket_contrib::templates::Template;
use rocket_contrib::serve::StaticFiles;
use pytron_web::Data;
#[get("/")]
fn hello() -> Template {
Template::render("index", &Data::test())
}
fn main() {
rocket::ignite()
.mount("/", routes![hello])
.mount("/static", StaticFiles::from("static"))
.attach(Template::fairing())
.launch();
}