Added more code

This commit is contained in:
2025-04-01 20:56:25 -04:00
parent f9a3103616
commit e17a304896
3 changed files with 19 additions and 0 deletions

View File

@@ -1,4 +1,21 @@
use axum::{Json, http::StatusCode};
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize)]
pub struct TestResult {
message: String,
}
// basic handler that responds with a static string
pub async fn root() -> &'static str {
"Hello, World!"
}
pub async fn db_ping() -> (StatusCode, Json<TestResult>) {
let tr = TestResult {
message: String::from("Should work"),
};
(StatusCode::OK, Json(tr))
}