Skip to content

Commit

Permalink
update /examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kanarus committed Aug 21, 2024
1 parent bf445b7 commit fbf50ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 3 additions & 11 deletions examples/hello/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Output = Result<(), Response>> + 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(())
}
}
}
Expand Down

0 comments on commit fbf50ad

Please sign in to comment.