From bf2578d19a04adeb2438ba81280327e885c1ded9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 11 Jan 2018 22:50:56 +0100 Subject: Move controller code to own module. --- src/main.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 109d7d1..0bbdc2e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,8 @@ use rocket_contrib::Json; #[macro_use] mod utils; mod models; mod schema; -mod posts; +mod controllers; +use controllers::posts_controller; #[derive(BartDisplay, Serialize)] #[template = "templates/index.html"] @@ -42,6 +43,12 @@ fn main() { rocket::ignite() .manage(utils::init_db_pool()) .mount("/", routes![index, index_json]) - .mount("/posts", routes![posts::new, posts::create, posts::show, posts::edit, posts::update]) + .mount("/posts", + routes![ + posts_controller::new, + posts_controller::create, + posts_controller::show, + posts_controller::edit, + posts_controller::update]) .launch(); } -- cgit v1.2.3