diff options
Diffstat (limited to 'examples/windmark.rs')
| -rw-r--r-- | examples/windmark.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/windmark.rs b/examples/windmark.rs index eaf7b43..80b0cba 100644 --- a/examples/windmark.rs +++ b/examples/windmark.rs @@ -58,6 +58,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { router.set_private_key_file("windmark_private.pem"); router.set_certificate_file("windmark_public.pem"); + #[cfg(feature = "logger")] router.enable_default_logger(true); router.set_error_handler(Box::new(move |_| { error_count += 1; @@ -185,13 +186,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { "/redirect", Box::new(|_| Response::PermanentRedirect("gemini://localhost/test".into())), ); + #[cfg(feature = "auto-deduce-mime")] + router.mount("/auto-file", { + Box::new(|_| Response::SuccessFileAuto(include_bytes!("../LICENSE"))) + }); router.mount("/file", { - #[cfg(feature = "auto-deduce-mime")] - { - Box::new(|_| Response::SuccessFile(include_bytes!("../LICENSE"))) - } - - #[cfg(not(feature = "auto-deduce-mime"))] Box::new(|_| { Response::SuccessFile( include_bytes!("../LICENSE"), |