diff --git a/examples/Cargo.toml b/examples/Cargo.toml index 91db6b1f..0d7ee831 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -16,7 +16,7 @@ members = [ [workspace.dependencies] # set `default-features = false` to assure "DEBUG" feature be off even when DEBUGing `../ohkami` -ohkami = { path = "../ohkami", default-features = false, features = ["rt_tokio", "testing", "sse", "ws"] } +ohkami = { path = "../ohkami", default-features = false, features = ["rt_tokio", "testing", "sse", "ws", "ip"] } tokio = { version = "1", features = ["full"] } sqlx = { version = "0.7.3", features = ["runtime-tokio-native-tls", "postgres", "macros", "chrono", "uuid"] } tracing = "0.1" diff --git a/examples/hello/src/main.rs b/examples/hello/src/main.rs index 4c9373f9..43ae72c7 100644 --- a/examples/hello/src/main.rs +++ b/examples/hello/src/main.rs @@ -84,17 +84,9 @@ mod fangs { #[derive(Clone)] pub struct LogRequest; impl FangAction for LogRequest { - fn fore<'a>(&'a self, req: &'a mut Request) -> impl std::future::Future> + Send { - let __method__ = req.method; - let __path__ = req.path.str(); - - tracing::info!("\n\ - Got request:\n\ - [ method ] {__method__}\n\ - [ path ] {__path__}\n\ - "); - - async {Ok(())} + async fn fore<'a>(&'a self, req: &'a mut Request) -> Result<(), Response> { + tracing::info!("\nGot request: {req:#?}"); + Ok(()) } } }