Initial commit
This commit is contained in:
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "message-hideyoshi_com"
|
||||
version = "0.1.0"
|
||||
19
src/handler/health.rs
Normal file
19
src/handler/health.rs
Normal 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
0
src/handler/message.rs
Normal file
0
src/handler/mod.rs
Normal file
0
src/handler/mod.rs
Normal file
0
src/model.rs
Normal file
0
src/model.rs
Normal file
8
src/model/generic_response.rs
Normal file
8
src/model/generic_response.rs
Normal 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
0
src/model/mod.rs
Normal file
5
src/model/send_message.rs
Normal file
5
src/model/send_message.rs
Normal file
@@ -0,0 +1,5 @@
|
||||
struct ReceivedMessage {
|
||||
subject: String,
|
||||
message: String,
|
||||
timestamp: std::time,
|
||||
}
|
||||
0
src/route.rs
Normal file
0
src/route.rs
Normal file
0
src/route/handler/mod.rs
Normal file
0
src/route/handler/mod.rs
Normal file
Reference in New Issue
Block a user