创建路由接口,用于summer_boot.new()的返回值使用,
该函数提供了对应方法summer_boot/src/web2/gateway/routes.rs文件下的所有路由方法,
- get
- head
- put
- post
- delete
- options
- connect
- patch
- trace
#[summer_boot_macro::post("/")]
async fn example(mut req: Request<()>) -> Result {
Ok(format!("Hello World").into())
}