Last active
February 23, 2017 14:10
-
-
Save goyox86/75a690492487cbd5446452c4738bbf8d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let env_str = &std_env::var("BLOG_ENV").unwrap_or(format!("development")); | |
let env = Env::from_str(env_str).unwrap(); | |
let db_config = DbConfig::load(&env).expect("Error loading DB configuration"); | |
let mut db = Db::new(db_config); | |
db.init(); | |
rocket::ignite() | |
.mount("/api/v1", routes![ | |
api_v1::posts::api_v1_posts_index, | |
api_v1::posts::api_v1_posts_create, | |
api_v1::posts::api_v1_posts_show, | |
api_v1::posts::api_v1_posts_update, | |
api_v1::posts::api_v1_posts_destroy | |
]).manage(db) | |
.launch()\ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment