aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-11-16 14:16:15 +0000
committerAkshay <[email protected]>2020-11-16 14:16:15 +0000
commit6cdd42567da8bc8e7fe1107f055da7fa3d260b60 (patch)
tree152c491a1b3a85883c33f804fea020ecb5fad183
parent67e5016829787c2398dcb1ceea6b6dca192ac27c (diff)
add basic product apis
-rw-r--r--src/bin/server.rs6
-rw-r--r--src/handlers/mod.rs1
2 files changed, 6 insertions, 1 deletions
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};
5use diesel::r2d2::{ConnectionManager, Pool}; 5use diesel::r2d2::{ConnectionManager, Pool};
6use diesel::MysqlConnection; 6use diesel::MysqlConnection;
7use furby::handlers::smoke::manual_hello; 7use furby::handlers::smoke::manual_hello;
8use furby::handlers::users; 8use furby::handlers::{product, users};
9use rand::Rng; 9use rand::Rng;
10 10
11#[actix_web::main] 11#[actix_web::main]
@@ -40,6 +40,10 @@ async fn main() -> std::io::Result<()> {
40 web::post().to(users::change_password), 40 web::post().to(users::change_password),
41 ), 41 ),
42 ) 42 )
43 .service(
44 web::scope("/product")
45 .route("/new", web::post().to(product::new_product)),
46 )
43 .route("/hey", web::get().to(manual_hello)) 47 .route("/hey", web::get().to(manual_hello))
44 }) 48 })
45 .bind("127.0.0.1:7878")? 49 .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 @@
1pub mod product;
1pub mod smoke; 2pub mod smoke;
2pub mod users; 3pub mod users;