mod extract;
mod pagination;
mod routes;
use axum::{
http::StatusCode,
response::{IntoResponse, Response},
};
pub use extract::{Json, Path, Query};
pub use pagination::{Page, PageMeta, Pagination};
pub use routes::{RouteInfo, Routes};
use serde::Serialize;
#[derive(Debug, Clone)]
pub struct Created<T>(pub T);
impl<T: Serialize> IntoResponse for Created<T> {
fn into_response(self) -> Response {
(StatusCode::CREATED, Json(self.0)).into_response()
}
}
#[derive(Debug, Clone, Copy)]
pub struct NoContent;
impl IntoResponse for NoContent {
fn into_response(self) -> Response {
StatusCode::NO_CONTENT.into_response()
}
}
pub async fn health() -> Json<serde_json::Value> {
Json(serde_json::json!({ "status": "ok" }))
}