rkt_codegen 0.6.0

Procedural macros for the rkt web framework.
Documentation
#![allow(dead_code)]

#[macro_use]
extern crate rkt;
use rkt::http::uri::Origin;
use rkt::request::Request;

async fn noop() {}

#[get("/")]
async fn hello(_origin: &Origin<'_>) -> &'static str {
    noop().await;
    "Hello, world!"
}

#[get("/repeated_query?<sort>")]
async fn repeated_query(sort: Vec<&str>) -> &str {
    noop().await;
    sort[0]
}

#[catch(404)]
async fn not_found(req: &Request<'_>) -> String {
    noop().await;
    format!("{} not found", req.uri())
}