aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes.rs
diff options
context:
space:
mode:
authoralpaylan2021-04-16 01:03:21 +0300
committeralpaylan2021-04-16 01:03:21 +0300
commitd248309f8595701a0fddd2462b963bcad55f18c8 (patch)
tree109d4e2809f9f3392612e86ab3d5a47df5830b11 /src/routes.rs
parent711d987b8e060682cf2215f25392415e206b3e8d (diff)
parenta1af17aad7c1308fc714a60595bae07cc8bb8a9a (diff)
downloadgradecoin-d248309f8595701a0fddd2462b963bcad55f18c8.tar.gz
gradecoin-d248309f8595701a0fddd2462b963bcad55f18c8.tar.bz2
gradecoin-d248309f8595701a0fddd2462b963bcad55f18c8.zip
Merge remote-tracking branch 'origin/main'
# Conflicts: # src/schema.rs
Diffstat (limited to 'src/routes.rs')
-rw-r--r--src/routes.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/routes.rs b/src/routes.rs
index 280de35..52d357a 100644
--- a/src/routes.rs
+++ b/src/routes.rs
@@ -7,11 +7,19 @@ use crate::schema::Db;
7 7
8/// Every route combined 8/// Every route combined
9pub fn consensus_routes(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { 9pub fn consensus_routes(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone {
10 // Remember when we wanted to implement templating
11 // Why would we? Just put a staic webpage under /public (next to Cargo.toml) and place it and
12 // the end of the filter chain
13
14 // Fully fledged website support, phew!
15 let static_route = warp::any().and(warp::fs::dir("public"));
16
10 transaction_list(db.clone()) 17 transaction_list(db.clone())
11 .or(register_user(db.clone())) 18 .or(register_user(db.clone()))
12 .or(auth_transaction_propose(db.clone())) 19 .or(auth_transaction_propose(db.clone()))
13 .or(auth_block_propose(db.clone())) 20 .or(auth_block_propose(db.clone()))
14 .or(block_list(db.clone())) 21 .or(block_list(db))
22 .or(static_route)
15} 23}
16 24
17/// POST /register warp route 25/// POST /register warp route
@@ -60,4 +68,3 @@ pub fn auth_block_propose(db: Db) -> impl Filter<Extract = impl Reply, Error = R
60 .and(custom_filters::with_db(db)) 68 .and(custom_filters::with_db(db))
61 .and_then(handlers::authorized_propose_block) 69 .and_then(handlers::authorized_propose_block)
62} 70}
63