aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/controllers/mod.rs1
-rw-r--r--src/controllers/posts_controller.rs (renamed from src/posts.rs)0
-rw-r--r--src/main.rs11
3 files changed, 10 insertions, 2 deletions
diff --git a/src/controllers/mod.rs b/src/controllers/mod.rs
new file mode 100644
index 0000000..0a95bd5
--- /dev/null
+++ b/src/controllers/mod.rs
@@ -0,0 +1 @@
+pub mod posts_controller;
diff --git a/src/posts.rs b/src/controllers/posts_controller.rs
index fde08a8..fde08a8 100644
--- a/src/posts.rs
+++ b/src/controllers/posts_controller.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();
}