diff --git a/src/hello/controller.rs b/src/hello/controller.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/hello/mod.rs b/src/hello/mod.rs new file mode 100644 index 0000000..6a664ab --- /dev/null +++ b/src/hello/mod.rs @@ -0,0 +1 @@ +pub mod routes; diff --git a/src/hello/routes.rs b/src/hello/routes.rs new file mode 100644 index 0000000..521b2ed --- /dev/null +++ b/src/hello/routes.rs @@ -0,0 +1,4 @@ +#[get("/world")] +pub fn world() -> &'static str { + "Hello, world!" +} diff --git a/src/ivago/controller.rs b/src/ivago/controller.rs new file mode 100644 index 0000000..0b3b0a3 --- /dev/null +++ b/src/ivago/controller.rs @@ -0,0 +1 @@ +mod ivago.controller; diff --git a/src/ivago/mod.rs b/src/ivago/mod.rs new file mode 100644 index 0000000..e69de29 diff --git a/src/ivago/routes.rs b/src/ivago/routes.rs new file mode 100644 index 0000000..da7e939 --- /dev/null +++ b/src/ivago/routes.rs @@ -0,0 +1 @@ +mod ivago.routes; diff --git a/src/main.rs b/src/main.rs index 745fcec..d149c41 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,11 +2,8 @@ #[macro_use] extern crate rocket; -#[get("/")] -fn index() -> &'static str { - "Hello, world!" -} +mod hello; fn main() { - rocket::ignite().mount("/", routes![index]).launch(); + rocket::ignite().mount("/hello", routes![hello::routes::world]).launch(); }