Skip to main content

endpoint

Macro endpoint 

Source
macro_rules! endpoint {
    (
        $name:ident,
        $method:ident,
        $path:literal,
        Response = $response:ty
    ) => { ... };
}
Expand description

Defines a simple Endpoint with no params or query.

§Examples

use better_fetch::endpoint;
use serde::Deserialize;

#[derive(Deserialize)]
pub struct Health {
    ok: bool,
}

endpoint!(HealthCheck, GET, "/health", Response = Health);