tide 0.16.0

A minimal and pragmatic Rust web application framework built for rapid development
Documentation
use tide::http::{Method, Request, Url};
use tide::Response;

#[async_std::test]
async fn should_accept_boxed_endpoints() {
    fn endpoint() -> Box<dyn tide::Endpoint<()>> {
        Box::new(|_| async { Ok("hello world") })
    }

    let mut app = tide::Server::new();
    app.at("/").get(endpoint());

    let mut response: Response = app
        .respond(Request::new(
            Method::Get,
            Url::parse("http://example.com/").unwrap(),
        ))
        .await
        .unwrap();

    assert_eq!(
        response.take_body().into_string().await.unwrap(),
        "hello world"
    );
}