diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/server.rs | 6 | ||||
-rw-r--r-- | src/handlers/mod.rs | 1 |
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}; | |||
5 | use diesel::r2d2::{ConnectionManager, Pool}; | 5 | use diesel::r2d2::{ConnectionManager, Pool}; |
6 | use diesel::MysqlConnection; | 6 | use diesel::MysqlConnection; |
7 | use furby::handlers::smoke::manual_hello; | 7 | use furby::handlers::smoke::manual_hello; |
8 | use furby::handlers::users; | 8 | use furby::handlers::{product, users}; |
9 | use rand::Rng; | 9 | use 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 @@ | |||
1 | pub mod product; | ||
1 | pub mod smoke; | 2 | pub mod smoke; |
2 | pub mod users; | 3 | pub mod users; |