Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
51508c818a | |||
322179ea13 | |||
5134624b06 | |||
2b24a6def1 | |||
0158d7d7e0 | |||
560aa3d2af |
6 changed files with 16 additions and 9 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -101,7 +101,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "axum-controller"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"axum-controller-macros",
|
||||
|
@ -114,7 +114,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "axum-controller-macros"
|
||||
version = "0.2.1"
|
||||
version = "0.2.2"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"prettyplease",
|
||||
|
|
|
@ -6,10 +6,10 @@ resolver = "3"
|
|||
authors = ["Tristan Druyen <ek36g2vcc@mozmail.com>"]
|
||||
categories = ["web-programming"]
|
||||
description = "Helper macro's for better readability of axum handlers"
|
||||
edition = "2024"
|
||||
edition = "2021"
|
||||
homepage = "https://git.vlt81.de/vault81/axum-controller"
|
||||
keywords = ["axum", "controller", "macro", "routing"]
|
||||
license = "AGPL-3.0-or-later"
|
||||
readme = "README.md"
|
||||
repository = "https://git.vlt81.de/vault81/axum-controller"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
[](https://crates.io/crates/axum-controller)
|
||||
[](https://docs.rs/axum-controller)
|
||||

|
||||
|
||||
# DEPRECATED
|
||||
|
||||
This crate does not receive further development, it *might* work for your use case.
|
||||
I've changed how I do routing & recommend checking out [axum-folder-router](https://crates.io/crates/axum-folder-router).
|
||||
|
||||
# Axum-Controller
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
use proc_macro::TokenStream;
|
||||
use proc_macro2::Ident;
|
||||
use syn::{
|
||||
ItemImpl, MetaNameValue,
|
||||
parse::{Parse, ParseStream},
|
||||
punctuated::Punctuated,
|
||||
ItemImpl, MetaNameValue,
|
||||
};
|
||||
#[macro_use]
|
||||
extern crate quote;
|
||||
|
@ -169,7 +169,7 @@ pub fn controller(attr: TokenStream, item: TokenStream) -> TokenStream {
|
|||
// one where it's #state
|
||||
let from_controller_into_router_impl = quote! {
|
||||
impl #struct_name {
|
||||
fn into_router(state: #state) -> axum::Router<#state> {
|
||||
pub fn into_router(state: #state) -> axum::Router<#state> {
|
||||
let __nested_router = axum::Router::new()
|
||||
#(#route_calls)*
|
||||
#(#middleware_calls)*
|
||||
|
|
|
@ -12,11 +12,12 @@ repository.workspace = true
|
|||
version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
axum-controller-macros = { path = "../axum-controller-macros", version = "0.2.1" }
|
||||
axum-typed-routing = { path = "../vendor/axum-typed-routing", version = "0.2.0", features = [ "aide"] }
|
||||
axum-controller-macros = { path = "../axum-controller-macros", version = "0.3" }
|
||||
axum-typed-routing = { path = "../vendor/axum-typed-routing", version = "0.2.0"}
|
||||
|
||||
[dev-dependencies]
|
||||
axum = "0.8"
|
||||
axum-typed-routing = { path = "../vendor/axum-typed-routing", version = "0.2", features = []}
|
||||
axum-test = { version = "17", features = [] }
|
||||
json = "0.12"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
|
|
@ -15,5 +15,5 @@
|
|||
//! ```
|
||||
|
||||
pub use axum_controller_macros::controller;
|
||||
pub use axum_typed_routing::TypedRouter;
|
||||
pub use axum_typed_routing::route;
|
||||
pub use axum_typed_routing::TypedRouter;
|
||||
|
|
Reference in a new issue