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 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/bin') 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")? -- cgit v1.2.3