Added more code
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user