Add health check route
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
5
src/routes/health.rs
Normal file
5
src/routes/health.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
use http::StatusCode;
|
||||
|
||||
pub async fn get() -> Result<StatusCode, StatusCode> {
|
||||
Ok(StatusCode::OK)
|
||||
}
|
@@ -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))
|
||||
|
Reference in New Issue
Block a user