Macro pillow_macros::route
source · route!() { /* proc-macro */ }
Expand description
Conver controller in route
use pillow::http::*;
#[controller(method = "GET", path = "/")]
fn index() -> Response {
Response::text("hello")
}
#[tokio::main]
async fn main() {
let mut router = MainRouter::new();
router.add_route(route!(index {}));
}