diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index 0153b04..dd130b7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,3 @@ -#![feature(const_extern_fn, async_closure)] #![deny( warnings, nonstandard_style, @@ -20,14 +19,13 @@ mod xml; #[macro_use] extern crate log; -use std::alloc::System; - use { // dotenv::var, pickledb::PickleDb, std::sync::{LazyLock, Mutex}, tokio::time::Instant, }; +use {std::alloc::System, windmark::router_option::RouterOption}; #[global_allocator] static A: System = System; @@ -56,8 +54,9 @@ static DATABASE: LazyLock<Mutex<PickleDb>> = LazyLock::new(|| { #[windmark::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { - std::env::set_var("RUST_LOG", "windmark,locus=trace"); - pretty_env_logger::init(); + pretty_env_logger::formatted_builder() + .parse_filters("windmark,locus=trace") + .init(); dotenv::dotenv().ok(); let mut time_mount = Instant::now(); @@ -70,7 +69,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> { router.set_error_handler(|_| { windmark::response::Response::not_found(ERROR_HANDLER_RESPONSE) }); - router.set_fix_path(true); + router.add_options(&[ + RouterOption::RemoveExtraTrailingSlash, + RouterOption::AddMissingTrailingSlash, + RouterOption::AllowCaseInsensitiveLookup, + ]); timing::time_section(&mut time_mount, "creating router"); timing::time_mounts("module", &mut time_mount, || { |