From c9179425911e7d5382e0582c62cf92462431695a Mon Sep 17 00:00:00 2001 From: Fabrice Bellamy <12b@distrilab.fr> Date: Mon, 21 Oct 2024 19:02:17 +0200 Subject: [PATCH] cargo loco generate controller home --htmx --- nixin_farm_ssr/src/app.rs | 1 + nixin_farm_ssr/src/controllers/home.rs | 10 ++++++++++ nixin_farm_ssr/src/controllers/mod.rs | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 nixin_farm_ssr/src/controllers/home.rs diff --git a/nixin_farm_ssr/src/app.rs b/nixin_farm_ssr/src/app.rs index f1d2b8d..374a861 100644 --- a/nixin_farm_ssr/src/app.rs +++ b/nixin_farm_ssr/src/app.rs @@ -50,6 +50,7 @@ impl Hooks for App { fn routes(_ctx: &AppContext) -> AppRoutes { AppRoutes::with_default_routes() + .add_route(controllers::home::routes()) .add_route(controllers::service::routes()) .add_route(controllers::bundle::routes()) .add_route(controllers::server::routes()) diff --git a/nixin_farm_ssr/src/controllers/home.rs b/nixin_farm_ssr/src/controllers/home.rs new file mode 100644 index 0000000..ce00300 --- /dev/null +++ b/nixin_farm_ssr/src/controllers/home.rs @@ -0,0 +1,10 @@ +#![allow(clippy::missing_errors_doc)] +#![allow(clippy::unnecessary_struct_initialization)] +#![allow(clippy::unused_async)] +use loco_rs::prelude::*; +use axum::debug_handler; + +pub fn routes() -> Routes { + Routes::new() + .prefix("homes") +} diff --git a/nixin_farm_ssr/src/controllers/mod.rs b/nixin_farm_ssr/src/controllers/mod.rs index ae02a00..171071a 100644 --- a/nixin_farm_ssr/src/controllers/mod.rs +++ b/nixin_farm_ssr/src/controllers/mod.rs @@ -3,4 +3,5 @@ pub mod user; pub mod server; pub mod bundle; -pub mod service; \ No newline at end of file +pub mod service; +pub mod home; \ No newline at end of file