aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/routes.rs')
-rw-r--r--src/routes.rs11
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 @@
3use crate::custom_filters; 3use crate::custom_filters;
4use crate::handlers; 4use crate::handlers;
5use crate::Db; 5use crate::Db;
6use warp::{Filter, Rejection, Reply}; 6use warp::{Filter, filters::BoxedFilter, Rejection, Reply};
7
8/// Every route combined
9pub 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
9pub 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