jder_axum

Crates.iojder_axum
lib.rsjder_axum
version0.3.0
sourcesrc
created_at2024-10-04 19:07:51.224552
updated_at2024-10-26 20:21:37.591034
descriptionA response builder for Axum
homepagehttps://github.com/alpheustangs/jder_axum
repositoryhttps://github.com/alpheustangs/jder_axum
max_upload_size
id1396987
size63,292
Alpheus (alpheustangs)

documentation

README

JDER Axum

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.

Quick Start

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
}

License

This project is MIT licensed, you can find the license file here.

Commit count: 20

cargo fmt