No description
Find a file
Tristan Druyen 10c3ba0aa5
Vastly improve testing
- simplify some examples
- add macrotest for expanding/snapshotting macro expansion & add tests
  - add workaround to enable referencing relative dirs from macrotest files
  - ensure workaround doesn't get built in release
- add trybuild for testing error messages & add tests
- fix indeterministic macro output
  - sort routes after collecting
  - use BTreeMap instead of HashMap to preserve insertion order
- fix compile_error syntax error
2025-04-15 13:32:48 +02:00
examples Vastly improve testing 2025-04-15 13:32:48 +02:00
src Vastly improve testing 2025-04-15 13:32:48 +02:00
tests Vastly improve testing 2025-04-15 13:32:48 +02:00
.envrc Initial commit 2025-04-14 15:59:43 +02:00
.gitignore Initial commit 2025-04-14 15:59:43 +02:00
Cargo.lock Vastly improve testing 2025-04-15 13:32:48 +02:00
Cargo.toml Vastly improve testing 2025-04-15 13:32:48 +02:00
CHANGELOG.md Fix docs & bump version to 0.3.1 2025-04-15 01:09:02 +02:00
flake.lock Initial commit 2025-04-14 15:59:43 +02:00
flake.nix Fix pedantic clippy lints 2025-04-15 03:41:41 +02:00
LICENSE.md Change license to MIT & bump to 0.2.2 2025-04-14 19:27:53 +02:00
README.md Rework README.md & CHANGELOG.md 2025-04-15 00:59:30 +02:00
rust-toolchain.toml Initial commit 2025-04-14 15:59:43 +02:00
rustfmt.toml Rewrite for better module handling 2025-04-14 18:37:43 +02:00

Crates.io Documentation Maintenance License: MIT

axum-folder-router

#[folder_router(...)] is a procedural attribute macro for the Axum web framework that automatically generates router boilerplate based on your direcory & file structure. Inspired by popular frameworks like next.js.

Features

  • File System-Based Routing: Define your API routes using intuitive folder structures
  • Reduced Boilerplate: Automatically generates route mapping code
  • IDE Support: Generates proper module imports for better rust-analyzer integration
  • Multiple Routers: Create separate folder-based routers in the same application

Usage

For detailed instructions see the examples or docs.rs.

License

This repository, is licensed permissively under the terms of the MIT license.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.

Attribution

This macro is based on the build.rs template by @richardanaya