From f14c4bc7fc74d39b31b049c10421609e6e048a69 Mon Sep 17 00:00:00 2001 From: necrashter Date: Sat, 23 Apr 2022 15:09:43 +0300 Subject: Support for multiple configs/routes --- src/routes.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/routes.rs') 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 @@ use crate::custom_filters; use crate::handlers; use crate::Db; -use warp::{Filter, Rejection, Reply}; - -/// Every route combined -pub fn application(db: Db) -> impl Filter + Clone { - // gradecoin-site (zola) outputs a public/, we serve it here - let static_route = warp::any().and(warp::fs::dir("public")); +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)) - .or(static_route) + .boxed() } /// GET /user warp route -- cgit v1.2.3-70-g09d2