pub fn api_get<HandlerParams, ApiParams, H>(handler: H) -> ApiMethodRouterwhere
HandlerParams: 'static,
ApiParams: 'static,
H: RequestHandler<HandlerParams> + AsApiOperation<ApiParams> + Send + Sync + 'static,Available on crate feature
openapi only.Expand description
Create a new ApiMethodRouter with a GET handler.
This is a shorthand to call ApiMethodRouter::new and then ApiMethodRouter::get.
ยงExamples
use cot::json::Json;
use cot::router::method::openapi::api_get;
async fn test_handler() -> Json<()> {
Json(())
}
let method_router = api_get(test_handler);