Initialize API

This commit is contained in:
2025-07-13 18:46:34 +00:00
parent 365c88e74a
commit d13146cc31
13 changed files with 2552 additions and 77 deletions
+20
View File
@@ -0,0 +1,20 @@
use axum::{Json, response::IntoResponse};
use reqwest::StatusCode;
use serde::Serialize;
#[derive(Debug, Serialize)]
pub struct Error {
pub status: u16,
pub message: String,
}
impl IntoResponse for Error {
fn into_response(self) -> axum::response::Response {
(
StatusCode::from_u16(self.status)
.expect("The status code provided was not a valid status code"),
Json(self),
)
.into_response()
}
}