diff options
author | necrashter | 2022-04-23 16:07:55 +0300 |
---|---|---|
committer | Yigit Sever | 2022-04-23 18:10:12 +0300 |
commit | 8d7a1c4337af570c691c3c16527b724ae57ed80f (patch) | |
tree | 17ecde85510c7322aa390f98c73446431e66a906 /src/handlers.rs | |
parent | bc0c945be9a76613ee89ce94e9b979b9ac0bf373 (diff) | |
download | gradecoin-8d7a1c4337af570c691c3c16527b724ae57ed80f.tar.gz gradecoin-8d7a1c4337af570c691c3c16527b724ae57ed80f.tar.bz2 gradecoin-8d7a1c4337af570c691c3c16527b724ae57ed80f.zip |
GET /config endpoint
Diffstat (limited to 'src/handlers.rs')
-rw-r--r-- | src/handlers.rs | 6 |
1 files changed, 6 insertions, 0 deletions
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( | |||
352 | Ok(warp::reply::with_status(res_json, StatusCode::CREATED)) | 352 | Ok(warp::reply::with_status(res_json, StatusCode::CREATED)) |
353 | } | 353 | } |
354 | 354 | ||
355 | /// GET /config | ||
356 | /// Returns the configuration settings of this network in JSON. | ||
357 | pub async fn get_config(db: Db) -> Result<impl warp::Reply, Infallible> { | ||
358 | Ok(reply::with_status(reply::json(&db.config), StatusCode::OK)) | ||
359 | } | ||
360 | |||
355 | /// GET /transaction | 361 | /// GET /transaction |
356 | /// Returns JSON array of transactions | 362 | /// Returns JSON array of transactions |
357 | pub async fn list_transactions(db: Db) -> Result<impl warp::Reply, Infallible> { | 363 | pub async fn list_transactions(db: Db) -> Result<impl warp::Reply, Infallible> { |