wsgi_app

CircuitPython framework for creating WSGI server compatible web applications. This does not include server implementation, which is necessary in order to create a web application with this library.

Implementation Notes

Software and Dependencies:

class adafruit_wsgi.wsgi_app.WSGIApp

The base WSGI Application class.

on_request(methods, rule, request_handler)

Register a Request Handler for a particular HTTP method and path. request_handler will be called whenever a matching HTTP request is received.

request_handler should accept the following args:
(Dict environ)
request_handler should return a tuple in the shape of:
(status, header_list, data_iterable)
Parameters:
  • methods (list) – the methods of the HTTP request to handle
  • rule (str) – the path rule of the HTTP request
  • request_handler (func) – the function to call
route(rule, methods=None)

A decorator to register a route rule with an endpoint function. if no methods are provided, default to GET