From 6cdd42567da8bc8e7fe1107f055da7fa3d260b60 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 16 Nov 2020 19:46:15 +0530 Subject: add basic product apis --- src/bin/server.rs | 6 +++++- src/handlers/mod.rs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bin/server.rs b/src/bin/server.rs index d074e4f..c28d041 100644 --- a/src/bin/server.rs +++ b/src/bin/server.rs @@ -5,7 +5,7 @@ use actix_web::{web, App, HttpServer}; use diesel::r2d2::{ConnectionManager, Pool}; use diesel::MysqlConnection; use furby::handlers::smoke::manual_hello; -use furby::handlers::users; +use furby::handlers::{product, users}; use rand::Rng; #[actix_web::main] @@ -40,6 +40,10 @@ async fn main() -> std::io::Result<()> { web::post().to(users::change_password), ), ) + .service( + web::scope("/product") + .route("/new", web::post().to(product::new_product)), + ) .route("/hey", web::get().to(manual_hello)) }) .bind("127.0.0.1:7878")? diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index 65d3519..41bba8d 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -1,2 +1,3 @@ +pub mod product; pub mod smoke; pub mod users; -- cgit v1.2.3