rust-lib/src/axum/app.rs
Martin Berg Alstad d5974dda20 Initial commit
2024-06-22 17:19:55 +02:00

21 lines
395 B
Rust

#[macro_export]
#[cfg(feature = "axum")]
macro_rules! create_app {
($router:expr) => {
$router
};
($router:expr, $($layer:expr),* $(,)?) => {
$router$(.layer($layer))*
};
}
#[cfg(all(test, feature = "axum"))]
mod tests {
use axum::Router;
#[test]
fn test_create_app_router_only() {
let _app: Router<()> = create_app!(Router::new());
}
}