From 2541f5f849e25d7a5483c5715ef2e84945016637 Mon Sep 17 00:00:00 2001 From: necrashter Date: Sat, 23 Apr 2022 15:17:34 +0300 Subject: Handle url_prefix in network --- src/routes.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/routes.rs b/src/routes.rs index f53a20c..60e4ffa 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -7,12 +7,16 @@ use warp::{Filter, filters::BoxedFilter, Rejection, Reply}; /// Every route combined for a single network pub fn network(db: Db) -> BoxedFilter<(impl Reply,)> { - transaction_list(db.clone()) - .or(register_user(db.clone())) - .or(auth_transaction_propose(db.clone())) - .or(auth_block_propose(db.clone())) - .or(list_users(db.clone())) - .or(block_list(db)) + let url_prefix = db.config.url_prefix.clone(); + warp::path(url_prefix) + .and( + transaction_list(db.clone()) + .or(register_user(db.clone())) + .or(auth_transaction_propose(db.clone())) + .or(auth_block_propose(db.clone())) + .or(list_users(db.clone())) + .or(block_list(db)) + ) .boxed() } -- cgit v1.2.3-70-g09d2