aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 43d07430232ea7c22f92f8f822135b2906496f9f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use windmark::Response;

#[windmark::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    windmark::Router::new()
        .set_private_key_file("windmark_starter_project_private.pem")
        .set_certificate_file("windmark_starter_project_public.pem")
        .mount("/", Box::new(|_| Response::Success("Hello, World!".into())))
        .set_error_handler(Box::new(|_| {
            Response::PermanentFailure("This route does not exist!".into())
        }))
        .run()
        .await
}