Crates.io | jder_axum |
lib.rs | jder_axum |
version | 0.3.0 |
source | src |
created_at | 2024-10-04 19:07:51.224552 |
updated_at | 2024-10-26 20:21:37.591034 |
description | A response builder for Axum |
homepage | https://github.com/alpheustangs/jder_axum |
repository | https://github.com/alpheustangs/jder_axum |
max_upload_size | |
id | 1396987 |
size | 63,292 |
A response builder for Axum.
This package includes several Axum response builders and different extractors based on the JSON response structure specified in JSON Data Error Response (JDER). With the builders and extractors provided, various kinds of responses can be created easily instead of sending plain text responses.
Create a JSON response for an Axum route:
use jder_axum::response::{
Response,
json::CreateJsonResponse,
};
async fn route() -> Response {
CreateJsonResponse::dataless().send()
}
And the response will be shown as below:
{
"success": true,
"data": null,
"error": null
}
This project is MIT licensed, you can find the license file here.