Skip to content

Commit e42a358

Browse files
committed
Updated README
1 parent f008fe4 commit e42a358

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,26 @@ svr.set_error_handler([](const auto& req, auto& res) {
173173
});
174174
```
175175

176+
### Pre routing handler
177+
178+
```cpp
179+
svr.set_pre_routing_handler([](const auto& req, auto& res) -> bool {
180+
if (req.path == "/hello") {
181+
res.set_content("world", "text/html");
182+
return true; // This request is handled
183+
}
184+
return false; // Let the router handle this request
185+
});
186+
```
187+
188+
### Post routing handler
189+
190+
```cpp
191+
svr.set_post_routing_handler([](const auto& req, auto& res) {
192+
res.set_header("ADDITIONAL_HEADER", "value");
193+
});
194+
```
195+
176196
### 'multipart/form-data' POST data
177197

178198
```cpp

0 commit comments

Comments
 (0)