You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: libraries/WebServer/examples/Middleware/Middleware.ino
+5-5
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
/**
2
2
* Basic example of using Middlewares with WebServer
3
-
*
3
+
*
4
4
* Middleware are common request/response processing functions that can be applied globally to all incoming requests or to specific handlers.
5
5
* They allow for a common processing thus saving memory and space to avoid duplicating code or states on multiple handlers.
6
-
*
6
+
*
7
7
* Once the example is flashed (with the correct WiFi credentials), you can test the following scenarios with the listed curl commands:
8
8
* - CORS Middleware: answers to OPTIONS requests with the specified CORS headers and also add CORS headers to the response when the request has the Origin header
9
9
* - Logging Middleware: logs the request and response to an output in a curl-like format
10
-
* - Authentication Middleware: test the authentication with Digest Auth
11
-
*
10
+
* - Authentication Middleware: test the authentication with Digest Auth
11
+
*
12
12
* You can also add your own Middleware by extending the Middleware class and implementing the run method.
13
13
* When implementing a Middleware, you can decide when to call the next Middleware in the chain by calling next().
14
-
*
14
+
*
15
15
* Middleware are execute in order of addition, the ones attached to the server will be executed first.
0 commit comments