rocket-pinboard/src/main.rs

31 lines
524 B
Rust
Raw Normal View History

2017-12-06 15:29:10 +01:00
#![feature(plugin)]
#![plugin(rocket_codegen)]
extern crate comrak;
extern crate glob;
extern crate inflector;
2017-12-06 15:29:10 +01:00
extern crate rocket;
2017-12-06 16:47:55 +01:00
extern crate rocket_contrib;
2017-12-06 15:29:10 +01:00
use rocket::Rocket;
2017-12-06 16:47:55 +01:00
use rocket_contrib::Template;
mod list;
mod static_files;
2017-12-06 15:29:10 +01:00
#[get("/")]
fn index() -> &'static str {
"Hello, world!"
}
fn rocket() -> Rocket {
let lists = list::List::load_all();
2017-12-06 15:29:10 +01:00
rocket::ignite()
.mount("/", routes![index, static_files::all])
2017-12-06 16:47:55 +01:00
.attach(Template::fairing())
}
fn main() {
rocket().launch();
2017-12-06 15:29:10 +01:00
}