Documentation updates
This commit is contained in:
@@ -26,6 +26,12 @@ Python interpreters that support it.
|
||||
.. autoclass:: microdot.Response
|
||||
:members:
|
||||
|
||||
``MultiDict`` class
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. autoclass:: microdot.MultiDict
|
||||
:members:
|
||||
|
||||
``microdot_asyncio`` module
|
||||
---------------------------
|
||||
|
||||
|
||||
@@ -6,14 +6,16 @@
|
||||
Microdot
|
||||
========
|
||||
|
||||
A minimalistic Python web framework for microcontrollers inspired by
|
||||
`Flask <https://flask.palletsprojects.com/>`_.
|
||||
Microdot is a minimalistic Python web framework for microcontrollers inspired
|
||||
by `Flask <https://flask.palletsprojects.com/>`_, and designed to run on
|
||||
systems with limited resources such as microcontrollers. It runs on standard
|
||||
Python and on `MicroPython <https://micropython.org>`_.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 3
|
||||
|
||||
intro
|
||||
api
|
||||
|
||||
* :ref:`genindex`
|
||||
* :ref:`modindex`
|
||||
* :ref:`search`
|
||||
|
||||
29
docs/intro.rst
Normal file
29
docs/intro.rst
Normal file
@@ -0,0 +1,29 @@
|
||||
Examples
|
||||
--------
|
||||
|
||||
The following is an example of a standard single or multi-threaded web
|
||||
server::
|
||||
|
||||
from microdot import Microdot
|
||||
|
||||
app = Microdot()
|
||||
|
||||
@app.route('/')
|
||||
def hello(request):
|
||||
return 'Hello, world!'
|
||||
|
||||
app.run()
|
||||
|
||||
Microdot also supports the asynchronous model and can be used under
|
||||
``asyncio``. The example that follows is equivalent to the one above, but uses
|
||||
coroutines for concurrency::
|
||||
|
||||
from microdot_asyncio import Microdot
|
||||
|
||||
app = Microdot()
|
||||
|
||||
@app.route('/')
|
||||
async def hello(request):
|
||||
return 'Hello, world!'
|
||||
|
||||
app.run()
|
||||
Reference in New Issue
Block a user