diff --git a/src/main.rs b/src/main.rs index 4c9c4a9..ac23cbf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ mod error; use axum::{Extension, Router}; use std::net::SocketAddr; -use axum::routing::post; +use axum::routing::{get, post}; use clap::Parser; use migration::{Migrator, MigratorTrait}; use crate::ingestion::ingestion::{monzo_batched_csv, monzo_batched_json, monzo_updated}; @@ -16,6 +16,10 @@ struct Config { database_url: String, } +async fn health_check() -> &'static str { + "Ok" +} + #[tokio::main] async fn main() -> anyhow::Result<()> { let config: Config = Config::parse(); @@ -24,6 +28,7 @@ async fn main() -> anyhow::Result<()> { tracing_subscriber::fmt::init(); let app = Router::new() + .route("/health", get(health_check)) .route("/monzo-updated", post(monzo_updated)) .route("/monzo-batch-export", post(monzo_batched_json)) .route("/monzo-csv-ingestion", post(monzo_batched_csv))