diff options
author | alpaylan | 2021-04-16 01:03:21 +0300 |
---|---|---|
committer | alpaylan | 2021-04-16 01:03:21 +0300 |
commit | b4212a90caa899785402c06d57216e75de0f1c88 (patch) | |
tree | 8adbe6eb6b451eee20d181f26ab771e0c5a920ee /src/routes.rs | |
parent | 82864341afc78b23b358cd775c70ffbfa0d0303f (diff) | |
parent | 72f8ae422eeb03ed87c7819af5d5e25758267b03 (diff) | |
download | gradecoin-b4212a90caa899785402c06d57216e75de0f1c88.tar.gz gradecoin-b4212a90caa899785402c06d57216e75de0f1c88.tar.bz2 gradecoin-b4212a90caa899785402c06d57216e75de0f1c88.zip |
Merge remote-tracking branch 'origin/main'
# Conflicts:
# src/schema.rs
Diffstat (limited to 'src/routes.rs')
-rw-r--r-- | src/routes.rs | 11 |
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 |
9 | pub fn consensus_routes(db: Db) -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { | 9 | pub 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 | |||