aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFuwn <[email protected]>2022-07-31 08:40:06 -1000
committerFuwn <[email protected]>2022-07-31 08:40:06 -1000
commit70a37ee724c2a8772eacb58e315d9ad0e09f6172 (patch)
treed678854a82e2cfdc5be7ab78c378639a3b37d071 /src
downloadwindmark-starter-project-70a37ee724c2a8772eacb58e315d9ad0e09f6172.tar.xz
windmark-starter-project-70a37ee724c2a8772eacb58e315d9ad0e09f6172.zip
feat: initial commit
Diffstat (limited to 'src')
-rw-r--r--src/main.rs14
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
+}