get

Attribute Macro get 

Source
#[get]
Expand description

GET route handler macro

§Example

#[rustapi::get("/users")]
async fn list_users() -> Json<Vec<User>> {
    Json(vec![])
}

#[rustapi::get("/users/{id}")]
async fn get_user(Path(id): Path<i64>) -> Result<User> {
    Ok(User { id, name: "John".into() })
}