aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorFuwn <[email protected]>2023-03-29 08:28:56 +0000
committerFuwn <[email protected]>2023-03-29 08:34:11 +0000
commite7f05fc3b45e3e068e8a8373782e7f519f40690d (patch)
treeb101bcfa9960ca7c7cbf9c2b735fb105b78357c8 /examples
parentrefactor(returnable): unify callback context (diff)
downloadwindmark-e7f05fc3b45e3e068e8a8373782e7f519f40690d.tar.xz
windmark-e7f05fc3b45e3e068e8a8373782e7f519f40690d.zip
feat(router): modify content from post-route callback
Diffstat (limited to 'examples')
-rw-r--r--examples/windmark.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/windmark.rs b/examples/windmark.rs
index fca1c97..b33f686 100644
--- a/examples/windmark.rs
+++ b/examples/windmark.rs
@@ -82,7 +82,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
context.url.to_string()
)
}));
- router.set_post_route_callback(Box::new(|context| {
+ router.set_post_route_callback(Box::new(|context, content| {
+ *content = content.replace("Welcome!", "Welcome to Windmark!");
+
info!(
"closed connection from {}",
context.tcp.peer_addr().unwrap().ip()