40 lines
856 B
Rust
40 lines
856 B
Rust
#![feature(proc_macro_hygiene, decl_macro, never_type, unsized_locals)]
|
|
|
|
#[macro_use]
|
|
extern crate rocket;
|
|
|
|
#[macro_use]
|
|
extern crate rocket_contrib;
|
|
|
|
#[macro_use]
|
|
extern crate diesel;
|
|
|
|
use rocket_contrib::templates::Template;
|
|
|
|
pub mod catchers;
|
|
pub mod db;
|
|
pub mod errors;
|
|
pub mod models;
|
|
pub mod routes;
|
|
pub mod schema;
|
|
|
|
fn main() {
|
|
let root_routes: Vec<rocket::Route> = {
|
|
routes::root::routes()
|
|
.into_iter()
|
|
.chain(routes::auth::routes().into_iter())
|
|
.collect()
|
|
};
|
|
|
|
let character_routes = routes::characters::routes();
|
|
let catchers = catchers::catchers();
|
|
|
|
rocket::ignite()
|
|
.attach(Template::fairing())
|
|
.attach(db::TenebrousDbConn::fairing())
|
|
.mount("/", root_routes)
|
|
.mount("/characters", character_routes)
|
|
.register(catchers)
|
|
.launch();
|
|
}
|