21 lines
605 B
Rust
21 lines
605 B
Rust
#[macro_use] extern crate rocket;
|
|
#[macro_use] extern crate diesel_migrations;
|
|
#[macro_use] extern crate diesel;
|
|
|
|
use rocket::fairing::AdHoc;
|
|
use rocket_dyn_templates::Template;
|
|
|
|
mod api;
|
|
pub mod schema;
|
|
mod site;
|
|
|
|
#[launch]
|
|
fn rocket() -> _ {
|
|
rocket::build()
|
|
.attach(schema::DbConn::fairing())
|
|
.attach(Template::fairing())
|
|
.attach(AdHoc::on_ignite("Run Migrations", schema::run_migrations))
|
|
.mount("/", routes![site::index, site::gamenights, site::add_game_night])
|
|
.mount("/api", routes![api::gamenights, api::gamenight_post_form, api::gamenight_post_json])
|
|
}
|