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