#![feature(proc_macro_hygiene, decl_macro)] #[macro_use] extern crate rocket; #[macro_use] extern crate rocket_contrib; #[macro_use] extern crate diesel; mod models; mod config; mod schema; mod routes; use routes::users::*; use routes::zones::*; #[database("db")] pub struct DbConn(diesel::SqliteConnection); #[launch] async fn rocket() -> rocket::Rocket { let app_config = config::load("config.toml".into()); println!("{:#?}", app_config); rocket::ignite() .manage(app_config) .attach(DbConn::fairing()) .mount("/api/v1", routes![ get_zone_records, create_user_zone, create_auth_token, create_user ]) }