diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..43d0743 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,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 +} |