1mod extract;
4mod pagination;
5mod routes;
6
7use axum::{
8 http::StatusCode,
9 response::{IntoResponse, Response},
10};
11pub use extract::{Json, Path, Query};
12pub use pagination::{Page, PageMeta, Pagination};
13pub use routes::{RouteInfo, Routes};
14use serde::Serialize;
15
16#[derive(Debug, Clone)]
18pub struct Created<T>(pub T);
19
20impl<T: Serialize> IntoResponse for Created<T> {
21 fn into_response(self) -> Response {
22 (StatusCode::CREATED, Json(self.0)).into_response()
23 }
24}
25
26#[derive(Debug, Clone, Copy)]
28pub struct NoContent;
29
30impl IntoResponse for NoContent {
31 fn into_response(self) -> Response {
32 StatusCode::NO_CONTENT.into_response()
33 }
34}
35
36pub async fn health() -> Json<serde_json::Value> {
38 Json(serde_json::json!({ "status": "ok" }))
39}