[][src]Macro octane::route

macro_rules! route {
    ( | $req : ident, $res : ident | $body : expr ) => { ... };
}

The route macro makes it easy to pass anonymous functions to app.METHODs.

Example

use octane::{route, router::{Flow, Route}};
use octane::server::Octane;

let mut app = Octane::new();
app.get(
    "/",
    route!(
        |req, res| {
            res.send("Hello, World");
            Flow::Stop
        }
    ),
);