| Crates.io | axum-distributed-routing-macros |
| lib.rs | axum-distributed-routing-macros |
| version | 0.1.4 |
| created_at | 2025-04-02 16:09:47.706057+00 |
| updated_at | 2025-07-30 23:55:40.952945+00 |
| description | Distributed routing macros for axum |
| homepage | https://github.com/0Killian/axum-distributed-routing.git |
| repository | https://github.com/0Killian/axum-distributed-routing.git |
| max_upload_size | |
| id | 1616770 |
| size | 17,116 |
[!WARNING] This crate is experimental, use at your own risk!
Provides utilities for generating statically typed distributed routes for axum.
use axum_distributed_routing::*;
struct MyState(String);
route_group!(MyRoutes, MyState);
route!(
group = MyRoutes,
path = "/hello/{name:String}",
method = GET,
async hello -> String {
format!("{} {}!", state.0, name)
}
);
#[tokio::main]
async fn main() {
let app = create_router!(MyRoutes);
let listener = tokio::net::TcpListener::bind("127.0.0.1:3000").await.unwrap();
axum::serve(listener, app).await.unwrap();
}