velto 1.9.0

Velto: expressive, async-native, and grounded Rust framework
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use velto::test::TestRequest;
use velto::{route, App, Response};

#[test]
fn test_homepage() {
    let mut app = App::new();
    route!(app, "/" => |_req| {
        Response::from_string("Hello, test!")
    });

    let res = TestRequest::new("GET", "/").send(&app);
    assert_eq!(res.status_code(), 200);
    assert!(res.body().contains("Hello"));
}