Initial commit

This commit is contained in:
2024-02-24 17:38:12 -03:00
commit 9fef149d10
11 changed files with 40 additions and 0 deletions

19
src/handler/health.rs Normal file
View File

@@ -0,0 +1,19 @@
use axum::{
extract::{Path, Query, State},
http::StatusCode,
response::IntoResponse,
Json,
};
use uuid::Uuid;
use crate::model::{GenericResponse};
pub async fn health_check() -> impl IntoResponse {
const MESSAGE: &str = "Server is running";
let response = GenericResponse {
status: StatusCode::OK.to_string(),
message: MESSAGE.to_string(),
};
(StatusCode::OK, Json(response))
}

0
src/handler/message.rs Normal file
View File

0
src/handler/mod.rs Normal file
View File

0
src/model.rs Normal file
View File

View File

@@ -0,0 +1,8 @@
use serde::Serialize;
#[derive(Serialize)]
pub struct GenericResponse {
pub status: String,
pub message: String,
}

0
src/model/mod.rs Normal file
View File

View File

@@ -0,0 +1,5 @@
struct ReceivedMessage {
subject: String,
message: String,
timestamp: std::time,
}

0
src/route.rs Normal file
View File

0
src/route/handler/mod.rs Normal file
View File