From e42a358da8cbd391ed8a7bd2a142bdfe6667122f Mon Sep 17 00:00:00 2001 From: yhirose Date: Thu, 7 Jan 2021 19:00:24 -0500 Subject: [PATCH] Updated README --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 8a086be..4bfc83d 100644 --- a/README.md +++ b/README.md @@ -173,6 +173,26 @@ svr.set_error_handler([](const auto& req, auto& res) { }); ``` +### Pre routing handler + +```cpp +svr.set_pre_routing_handler([](const auto& req, auto& res) -> bool { + if (req.path == "/hello") { + res.set_content("world", "text/html"); + return true; // This request is handled + } + return false; // Let the router handle this request +}); +``` + +### Post routing handler + +```cpp +svr.set_post_routing_handler([](const auto& req, auto& res) { + res.set_header("ADDITIONAL_HEADER", "value"); +}); +``` + ### 'multipart/form-data' POST data ```cpp