Files
herald/src/api.rs
T
2026-05-18 22:40:28 +02:00

18 lines
442 B
Rust

use axum::Router;
use axum::routing::get;
use crate::env;
pub async fn start_api(config: env::EnvConfig) -> anyhow::Result<()> {
let app = Router::new().route("/webhook", get(webhook));
let listerner = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", config.http_port)).await?;
axum::serve(listerner, app)
.await
.map_err(|e| anyhow::anyhow!(e))
}
async fn webhook() -> &'static str {
"Hello, World!"
}