#[controller]Expand description
Defines a controller with a base path.
This macro should be used in combination with the #[routes] macro.
§Parameters
base_path: The base path for the controller, e.g., “/api
§Usage
ⓘ
#[controller("/base_path")]
struct MyController {}
#[routes]
impl MyController {
#[get("/sub_path")]
async fn my_handler(&self) -> HttpResponse {
Ok(HttpResponse::Ok().message("Hello from MyController"))
}
}