diff options
Diffstat (limited to 'src/handlers.rs')
-rw-r--r-- | src/handlers.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/handlers.rs b/src/handlers.rs index 93781e4..ae82441 100644 --- a/src/handlers.rs +++ b/src/handlers.rs | |||
@@ -361,6 +361,19 @@ pub async fn get_config(db: Db) -> Result<impl warp::Reply, Infallible> { | |||
361 | Ok(reply::with_status(reply::json(&db.config), StatusCode::OK)) | 361 | Ok(reply::with_status(reply::json(&db.config), StatusCode::OK)) |
362 | } | 362 | } |
363 | 363 | ||
364 | /// GET /version | ||
365 | /// Returns the current project version, as defined in Cargo.toml | ||
366 | pub async fn get_version() -> Result<impl warp::Reply, Infallible> { | ||
367 | Ok(reply::with_status( | ||
368 | reply::html(format!( | ||
369 | "{} - version {}", | ||
370 | env!("CARGO_PKG_NAME"), | ||
371 | env!("CARGO_PKG_VERSION") | ||
372 | )), | ||
373 | StatusCode::OK, | ||
374 | )) | ||
375 | } | ||
376 | |||
364 | /// GET /transaction | 377 | /// GET /transaction |
365 | /// Returns JSON array of transactions | 378 | /// Returns JSON array of transactions |
366 | pub async fn list_transactions(db: Db) -> Result<impl warp::Reply, Infallible> { | 379 | pub async fn list_transactions(db: Db) -> Result<impl warp::Reply, Infallible> { |