diff options
Diffstat (limited to 'src/routes.rs')
-rw-r--r-- | src/routes.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/routes.rs b/src/routes.rs index 52d357a..211f832 100644 --- a/src/routes.rs +++ b/src/routes.rs | |||
@@ -18,10 +18,19 @@ pub fn consensus_routes(db: Db) -> impl Filter<Extract = impl Reply, Error = Rej | |||
18 | .or(register_user(db.clone())) | 18 | .or(register_user(db.clone())) |
19 | .or(auth_transaction_propose(db.clone())) | 19 | .or(auth_transaction_propose(db.clone())) |
20 | .or(auth_block_propose(db.clone())) | 20 | .or(auth_block_propose(db.clone())) |
21 | .or(list_users(db.clone())) | ||
21 | .or(block_list(db)) | 22 | .or(block_list(db)) |
22 | .or(static_route) | 23 | .or(static_route) |
23 | } | 24 | } |
24 | 25 | ||
26 | /// GET /user warp route | ||
27 | pub fn list_users(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { | ||
28 | warp::path!("user") | ||
29 | .and(warp::get()) | ||
30 | .and(custom_filters::with_db(db)) | ||
31 | .and_then(handlers::user_list_handler) | ||
32 | } | ||
33 | |||
25 | /// POST /register warp route | 34 | /// POST /register warp route |
26 | pub fn register_user(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { | 35 | pub fn register_user(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { |
27 | warp::path!("register") | 36 | warp::path!("register") |