1
0
mirror of https://github.com/actix/examples synced 2025-06-27 01:27:43 +02:00

chore: rename middleware dirs

This commit is contained in:
Rob Ede
2023-10-29 23:51:05 +00:00
parent 5d36d72976
commit 0de1c02762
21 changed files with 43 additions and 38 deletions

View File

@ -0,0 +1,17 @@
# Middleware: Add/Retrieve Request-Local Data
This example showcases a middleware that adds and retrieves request-local data. See also the [middleware guide](https://actix.rs/docs/middleware).
## Usage
```sh
cd middleware/request-extensions
cargo run
```
Look in `src/add_msg.rs` to see how it works.
## Routes
- [GET /on](http://localhost:8080/on) - `200 OK` with "hello from middleware" body and console log showing the request passed through the middleware
- [GET /off](http://localhost:8080/off) - `500 Internal Server Error` with "no message found" body and console log showing the request passed through the middleware