Add health check route

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-01-25 11:02:03 +00:00
parent 002f70e299
commit 29b7966dfe
2 changed files with 7 additions and 0 deletions

5
src/routes/health.rs Normal file
View File

@@ -0,0 +1,5 @@
use http::StatusCode;
pub async fn get() -> Result<StatusCode, StatusCode> {
Ok(StatusCode::OK)
}

View File

@@ -1,4 +1,5 @@
pub mod assets;
pub mod health;
use crate::{config::Config, threads};
use axum::{
@@ -14,6 +15,7 @@ pub async fn run(
asset_status_sender: mpsc::Sender<threads::data::asset_status::Message>,
) {
let app = Router::new()
.route("/health", get(health::get))
.route("/assets", get(assets::get))
.route("/assets/:symbol", get(assets::get_where_symbol))
.route("/assets", post(assets::add))