From 8d7a1c4337af570c691c3c16527b724ae57ed80f Mon Sep 17 00:00:00 2001 From: necrashter Date: Sat, 23 Apr 2022 16:07:55 +0300 Subject: GET /config endpoint --- src/routes.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/routes.rs') diff --git a/src/routes.rs b/src/routes.rs index 9eadbea..651626a 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -19,6 +19,7 @@ pub fn network(db: Db) -> BoxedFilter<(impl Reply,)> { }; root.and( transaction_list(db.clone()) + .or(get_config_route(db.clone())) .or(register_user(db.clone())) .or(auth_transaction_propose(db.clone())) .or(auth_block_propose(db.clone())) @@ -28,6 +29,14 @@ pub fn network(db: Db) -> BoxedFilter<(impl Reply,)> { .boxed() } +/// GET /config warp route +pub fn get_config_route(db: Db) -> impl Filter + Clone { + warp::path!("config") + .and(warp::get()) + .and(custom_filters::with_db(db)) + .and_then(handlers::get_config) +} + /// GET /user warp route pub fn list_users(db: Db) -> impl Filter + Clone { warp::path!("user") -- cgit v1.2.3-70-g09d2