Function roa::router::options

source · []
pub fn options<S>(endpoint: impl for<'a> Endpoint<'a, S>) -> Dispatcher<S>
This is supported on crate feature router only.
Expand description

Function to construct dispatcher with Method::OPTIONS and an endpoint.

You can use it as follow:

use roa::{App, Context, Result};
use roa::router::options;

async fn end(ctx: &mut Context) -> Result {
    Ok(())
}

let app = App::new().end(options(end));