Skip to content

Commit 84effa5

Browse files
dranikpgThe-EDev
authored andcommitted
Update docs
1 parent 81ae1c9 commit 84effa5

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docs/guides/included-middleware.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Crow contains some middlewares that are ready to be used in your application.
2-
2+
<br>
33
Make sure you understand how to enable and use [middleware](../middleware/).
44

55
## Cookies
@@ -10,15 +10,17 @@ This middleware allows to read and write cookies by using `CookieParser`. Once e
1010

1111
Cookies can be read and written with the middleware context. All cookie attributes can be changed as well.
1212

13-
```c++
13+
```cpp
1414
auto& ctx = app.get_context<crow::CookieParser>(request);
1515
std::string value = ctx.get_cookie("key");
1616
ctx.set_cookie("key", "value")
1717
.path("/")
1818
.max_age(120);
1919
```
2020

21-
**Note**: Make sure the CookieParser is listed before other middleware that relies on it
21+
!!! note
22+
23+
Make sure `CookieParser` is listed before any other middleware that relies on it.
2224

2325
## CORS
2426
Include: `crow/middlewares/cors.h` <br>
@@ -30,7 +32,7 @@ The CORS rules can be modified by first getting the middleware via `#!cpp auto&
3032

3133
`CORSRules` can be modified using the methods `origin()`, `methods()`, `headers()`, `max_age()`, `allow_credentials()`, or `ignore()`. For more details on these methods and what default values they take go [here](../../reference/structcrow_1_1_c_o_r_s_rules.html).
3234

33-
```c++
35+
```cpp
3436
auto& cors = app.get_middleware<crow::CORSHandler>();
3537
cors
3638
.global()

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ nav:
5555
- Writing Tests: guides/testing.md
5656
- Using Crow:
5757
- HTTP Authorization: guides/auth.md
58-
- CORS Setup: guides/CORS.md
58+
- Included Middlewares: guides/included-middleware.md
5959
- Server setup:
6060
- Proxies: guides/proxies.md
6161
- Systemd run on startup: guides/syste.md

0 commit comments

Comments
 (0)