axum-folder-router/CHANGELOG.md

1.1 KiB

Unreleased

Breaking

Rework into attribute macro.

Instead of using it like this

// ...
folder_router!("./examples/simple/api", AppState);

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // ...
    let folder_router: Router<AppState> = folder_router();
    // ...
    Ok(())
}

It now works like this:

// ...
#[folder_router("./examples/simple/api", AppState)]
struct MyFolderRouter

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // ...
    let folder_router: Router<AppState> = MyFolderRouter::into_router();
    // ...
    Ok(())
}

This is a bit cleaner & it allows you to have multiple separate folder-based Routers.

0.2.3

  • Refactored the detection of which methods exist, we actually parse the file now instead of just checking that it contains pub async #method_name

0.2.2

  • Re-licensed to MIT

0.2.1

  • Documentation & test improvements

0.2.0

  • Generate module imports instead of include!ing, so rust-analyzer works.

0.1.0