diff options
author | necrashter | 2022-04-23 16:07:55 +0300 |
---|---|---|
committer | Yigit Sever | 2022-04-23 18:10:12 +0300 |
commit | 8d7a1c4337af570c691c3c16527b724ae57ed80f (patch) | |
tree | 17ecde85510c7322aa390f98c73446431e66a906 /src/routes.rs | |
parent | bc0c945be9a76613ee89ce94e9b979b9ac0bf373 (diff) | |
download | gradecoin-8d7a1c4337af570c691c3c16527b724ae57ed80f.tar.gz gradecoin-8d7a1c4337af570c691c3c16527b724ae57ed80f.tar.bz2 gradecoin-8d7a1c4337af570c691c3c16527b724ae57ed80f.zip |
GET /config endpoint
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 9eadbea..651626a 100644 --- a/src/routes.rs +++ b/src/routes.rs | |||
@@ -19,6 +19,7 @@ pub fn network(db: Db) -> BoxedFilter<(impl Reply,)> { | |||
19 | }; | 19 | }; |
20 | root.and( | 20 | root.and( |
21 | transaction_list(db.clone()) | 21 | transaction_list(db.clone()) |
22 | .or(get_config_route(db.clone())) | ||
22 | .or(register_user(db.clone())) | 23 | .or(register_user(db.clone())) |
23 | .or(auth_transaction_propose(db.clone())) | 24 | .or(auth_transaction_propose(db.clone())) |
24 | .or(auth_block_propose(db.clone())) | 25 | .or(auth_block_propose(db.clone())) |
@@ -28,6 +29,14 @@ pub fn network(db: Db) -> BoxedFilter<(impl Reply,)> { | |||
28 | .boxed() | 29 | .boxed() |
29 | } | 30 | } |
30 | 31 | ||
32 | /// GET /config warp route | ||
33 | pub fn get_config_route(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { | ||
34 | warp::path!("config") | ||
35 | .and(warp::get()) | ||
36 | .and(custom_filters::with_db(db)) | ||
37 | .and_then(handlers::get_config) | ||
38 | } | ||
39 | |||
31 | /// GET /user warp route | 40 | /// GET /user warp route |
32 | pub fn list_users(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { | 41 | pub fn list_users(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { |
33 | warp::path!("user") | 42 | warp::path!("user") |