ntex 4.7.0

Framework for composable network services
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use ntex::web;

#[derive(Debug, thiserror::Error)]
#[error("my error")]
struct MyError;

async fn index() -> Result<&'static str, MyError> {
    Err(MyError)
}

fn main() {
    let _ = web::App::default().route("/", web::get().to(index));
}