@@ -39,7 +39,7 @@ In order to save memory, we are unregistering unused MIME types and registering
3939
4040.. literalinclude :: ../examples/httpserver_static_files_serving.py
4141 :caption: examples/httpserver_static_files_serving.py
42- :emphasize-lines: 12-18,23-26
42+ :emphasize-lines: 11-17,22-25
4343 :linenos:
4444
4545You can also serve a specific file from the handler.
@@ -51,7 +51,7 @@ By doing that, you can serve files from multiple directories, and decide exactly
5151
5252.. literalinclude :: ../examples/httpserver_handler_serves_file.py
5353 :caption: examples/httpserver_handler_serves_file.py
54- :emphasize-lines: 13,22
54+ :emphasize-lines: 12,21
5555 :linenos:
5656
5757.. literalinclude :: ../examples/home.html
@@ -74,7 +74,7 @@ a running total of the last 10 samples.
7474
7575.. literalinclude :: ../examples/httpserver_start_and_poll.py
7676 :caption: examples/httpserver_start_and_poll.py
77- :emphasize-lines: 29,38
77+ :emphasize-lines: 28,37
7878 :linenos:
7979
8080
@@ -86,7 +86,7 @@ without needing to manually manage the timing of each task.
8686
8787.. literalinclude :: ../examples/httpserver_start_and_poll_asyncio.py
8888 :caption: examples/httpserver_start_and_poll_asyncio.py
89- :emphasize-lines: 5,33,42,45,50,55-62
89+ :emphasize-lines: 5,6,34,43,46,51,56-63
9090 :linenos:
9191
9292Server with MDNS
@@ -101,7 +101,7 @@ On some routers it is also possible to use ``http://custom-mdns-hostname:5000/``
101101
102102.. literalinclude :: ../examples/httpserver_mdns.py
103103 :caption: examples/httpserver_mdns.py
104- :emphasize-lines: 12-14
104+ :emphasize-lines: 11-13
105105 :linenos:
106106
107107Get CPU information
@@ -115,7 +115,7 @@ More info: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
115115
116116.. literalinclude :: ../examples/httpserver_cpu_information.py
117117 :caption: examples/httpserver_cpu_information.py
118- :emphasize-lines: 9,15-18,33
118+ :emphasize-lines: 9,14-17,32
119119 :linenos:
120120
121121Handling different methods
@@ -134,7 +134,7 @@ In example below, handler for ``/api`` and ``/api/`` route will be called when a
134134
135135.. literalinclude :: ../examples/httpserver_methods.py
136136 :caption: examples/httpserver_methods.py
137- :emphasize-lines: 8,19,26,30,49
137+ :emphasize-lines: 8,18,25,29,46
138138 :linenos:
139139
140140Change NeoPixel color
@@ -156,7 +156,7 @@ Tested on ESP32-S2 Feather.
156156
157157.. literalinclude :: ../examples/httpserver_neopixel.py
158158 :caption: examples/httpserver_neopixel.py
159- :emphasize-lines: 26-28,41,52,68,74
159+ :emphasize-lines: 25-27,40,51,67,73
160160 :linenos:
161161
162162Templates
@@ -209,7 +209,7 @@ return only the first one.
209209
210210.. literalinclude :: ../examples/httpserver_form_data.py
211211 :caption: examples/httpserver_form_data.py
212- :emphasize-lines: 32,47,50
212+ :emphasize-lines: 31,46,49
213213 :linenos:
214214
215215Cookies
@@ -223,7 +223,7 @@ In order to set cookies, pass ``cookies`` dictionary to ``Response`` constructo
223223
224224.. literalinclude :: ../examples/httpserver_cookies.py
225225 :caption: examples/httpserver_cookies.py
226- :emphasize-lines: 70,74-75,82
226+ :emphasize-lines: 69,73-74,81
227227 :linenos:
228228
229229Chunked response
@@ -235,7 +235,7 @@ constructor.
235235
236236.. literalinclude :: ../examples/httpserver_chunked.py
237237 :caption: examples/httpserver_chunked.py
238- :emphasize-lines: 8,21-26,28
238+ :emphasize-lines: 8,20-25,27
239239 :linenos:
240240
241241URL parameters and wildcards
@@ -271,7 +271,7 @@ In both cases, wildcards will not match empty path segment, so ``/api/.../users`
271271
272272.. literalinclude :: ../examples/httpserver_url_parameters.py
273273 :caption: examples/httpserver_url_parameters.py
274- :emphasize-lines: 30-34,53-54,65-66
274+ :emphasize-lines: 29-31,48-49,60-61
275275 :linenos:
276276
277277Authentication
@@ -284,15 +284,15 @@ If you want to apply authentication to the whole server, you need to call ``.req
284284
285285.. literalinclude :: ../examples/httpserver_authentication_server.py
286286 :caption: examples/httpserver_authentication_server.py
287- :emphasize-lines: 8,11-16,20
287+ :emphasize-lines: 8,10-15,19
288288 :linenos:
289289
290290On the other hand, if you want to apply authentication to a set of routes, you need to call ``require_authentication `` function.
291291In both cases you can check if ``request `` is authenticated by calling ``check_authentication `` on it.
292292
293293.. literalinclude :: ../examples/httpserver_authentication_handlers.py
294294 :caption: examples/httpserver_authentication_handlers.py
295- :emphasize-lines: 9-16,22-27,35,49,61
295+ :emphasize-lines: 9-16,21-26,34,48,60
296296 :linenos:
297297
298298Redirects
@@ -309,7 +309,7 @@ Alternatively, you can pass a ``status`` object directly to ``Redirect`` constru
309309
310310.. literalinclude :: ../examples/httpserver_redirects.py
311311 :caption: examples/httpserver_redirects.py
312- :emphasize-lines: 22-26,32,38,50,62
312+ :emphasize-lines: 21-25,31,37,49,61
313313 :linenos:
314314
315315Server-Sent Events
@@ -329,7 +329,7 @@ response object somewhere, so that it can be accessed later.
329329
330330.. literalinclude :: ../examples/httpserver_sse.py
331331 :caption: examples/httpserver_sse.py
332- :emphasize-lines: 10 ,17,46-53,63
332+ :emphasize-lines: 11 ,17,46-53,63
333333 :linenos:
334334
335335Websockets
@@ -352,7 +352,7 @@ but it is recommended as it makes it easier to handle multiple tasks. It can be
352352
353353.. literalinclude :: ../examples/httpserver_websocket.py
354354 :caption: examples/httpserver_websocket.py
355- :emphasize-lines: 12,20,65-72,88,99
355+ :emphasize-lines: 14,21,66-73,89,100
356356 :linenos:
357357
358358Custom response types e.g. video streaming
@@ -369,7 +369,7 @@ video to multiple clients while simultaneously handling other requests.
369369
370370.. literalinclude :: ../examples/httpserver_video_stream.py
371371 :caption: examples/httpserver_video_stream.py
372- :emphasize-lines: 31-77,92
372+ :emphasize-lines: 30-72,87
373373 :linenos:
374374
375375HTTPS
@@ -389,7 +389,7 @@ and setting ``https=True``.
389389
390390.. literalinclude :: ../examples/httpserver_https.py
391391 :caption: examples/httpserver_https.py
392- :emphasize-lines: 15-17
392+ :emphasize-lines: 14-16
393393 :linenos:
394394
395395
@@ -418,7 +418,7 @@ You can share same handler functions between servers or use different ones for e
418418
419419.. literalinclude :: ../examples/httpserver_multiple_servers.py
420420 :caption: examples/httpserver_multiple_servers.py
421- :emphasize-lines: 13-14,16-17,20,28,36-37,48-49,54-55
421+ :emphasize-lines: 12-13,15-16,19,27,35-36,47-48,53-54
422422 :linenos:
423423
424424Debug mode
0 commit comments