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/handlers.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/handlers.rs') diff --git a/src/handlers.rs b/src/handlers.rs index d2a834f..44c5299 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -352,6 +352,12 @@ pub async fn authenticate_user( Ok(warp::reply::with_status(res_json, StatusCode::CREATED)) } +/// GET /config +/// Returns the configuration settings of this network in JSON. +pub async fn get_config(db: Db) -> Result { + Ok(reply::with_status(reply::json(&db.config), StatusCode::OK)) +} + /// GET /transaction /// Returns JSON array of transactions pub async fn list_transactions(db: Db) -> Result { -- cgit v1.2.3-70-g09d2