Improve README.md

This commit is contained in:
Tristan D. 2025-04-14 16:11:38 +02:00
parent a992268843
commit b3771ba87a
Signed by: tristan
SSH key fingerprint: SHA256:9oFM1J63hYWJjCnLG6C0fxBS15rwNcWwdQNMOHYKJ/4
2 changed files with 1 additions and 9 deletions

View file

@ -23,7 +23,6 @@ Contact me if this doesn't suit your needs.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later) license, shall be licensed as above, without any additional terms or conditions. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later) license, shall be licensed as above, without any additional terms or conditions.
### Attribution ### Attribution
This macro is based on the [build.rs template by @richardanaya](https://github.com/richardanaya/axum-folder-router-htmx) This macro is based on the [build.rs template by @richardanaya](https://github.com/richardanaya/axum-folder-router-htmx)

View file

@ -104,6 +104,7 @@
//! ### State Extraction //! ### State Extraction
//! //!
//! The state type provided to the macro is available in all route handlers: //! The state type provided to the macro is available in all route handlers:
//! All routes share the same state type, though you can use ```FromRef``` for more granular state extraction.
//! //!
//! ```rust //! ```rust
//! use axum::{ //! use axum::{
@ -122,15 +123,7 @@
//! ## Limitations //! ## Limitations
//! //!
//! - **Compile-time Only**: The routing is determined at compile time, so dynamic route registration isn't supported. //! - **Compile-time Only**: The routing is determined at compile time, so dynamic route registration isn't supported.
//! - **File I/O**: The macro performs file I/O during compilation, which may have implications in certain build environments.
//! - **Single State Type**: All routes share the same state type, though you can use ```FromRef``` for more granular state extraction.
//! //!
//! ## Best Practices
//!
//! 1. **Consistent Structure**: Maintain a consistent file structure to make your API organization predictable.
//! 2. **Individual Route Files**: Use one ```route.rs``` file per route path for clarity.
//! 3. **Module Organization**: Consider grouping related functionality in directories.
//! 4. **Documentation**: Add comments to each route handler explaining its purpose.
use proc_macro::TokenStream; use proc_macro::TokenStream;
use quote::{format_ident, quote}; use quote::{format_ident, quote};