diff options
Diffstat (limited to 'src/routes.rs')
-rw-r--r-- | src/routes.rs | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/routes.rs b/src/routes.rs index cdbfc08..f53a20c 100644 --- a/src/routes.rs +++ b/src/routes.rs | |||
@@ -3,20 +3,17 @@ | |||
3 | use crate::custom_filters; | 3 | use crate::custom_filters; |
4 | use crate::handlers; | 4 | use crate::handlers; |
5 | use crate::Db; | 5 | use crate::Db; |
6 | use warp::{Filter, Rejection, Reply}; | 6 | use warp::{Filter, filters::BoxedFilter, Rejection, Reply}; |
7 | |||
8 | /// Every route combined | ||
9 | pub fn application(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { | ||
10 | // gradecoin-site (zola) outputs a public/, we serve it here | ||
11 | let static_route = warp::any().and(warp::fs::dir("public")); | ||
12 | 7 | ||
8 | /// Every route combined for a single network | ||
9 | pub fn network(db: Db) -> BoxedFilter<(impl Reply,)> { | ||
13 | transaction_list(db.clone()) | 10 | transaction_list(db.clone()) |
14 | .or(register_user(db.clone())) | 11 | .or(register_user(db.clone())) |
15 | .or(auth_transaction_propose(db.clone())) | 12 | .or(auth_transaction_propose(db.clone())) |
16 | .or(auth_block_propose(db.clone())) | 13 | .or(auth_block_propose(db.clone())) |
17 | .or(list_users(db.clone())) | 14 | .or(list_users(db.clone())) |
18 | .or(block_list(db)) | 15 | .or(block_list(db)) |
19 | .or(static_route) | 16 | .boxed() |
20 | } | 17 | } |
21 | 18 | ||
22 | /// GET /user warp route | 19 | /// GET /user warp route |