Wykres commitów

2 Commity (4c0a6908e440b6457ec5e8a8a97d22f9f60984b3)

Autor SHA1 Wiadomość Data
Phil Howard 78d50c2986 PicoWireless: ppwhttp add wildcard routes
This slightly reckless extension to ppwhttp adds support for wildcard routes, eg:

/get_led/<int:index>

Which will serve URLs in the form:

/get_led/10
/get_led/22

etc.

The wildcard includes <type:key>, attempting to match the behaviour of Flask.

Only type "int" is supported currently.

/get_led/<index> - would set data["index"] to a string
/get_led/<int:index> - would attempt to parse the URL part to an int, and would not serve eg: /get_led/hi

See plasma_ws2812_http.py for example usage.
2021-09-29 16:27:02 +01:00
Phil Howard 9f07be90da PicoWireless: move HTTP code to ppwhttp library
Creates a new ppwhttp library to hide the implementation detail of HTTP clients/servers from the examples.

Adds a new example - plasma_ws2812_http.py - showing how to expand rgb_http.py to use a WS2812 pixel strip.

Adds "secrets.py" and moves WIFI connection information there. ppwhttp will throw an error if it's missing.
2021-09-29 12:20:06 +01:00