Documentation updates

This commit is contained in:
Miguel Grinberg
2021-06-05 12:53:57 +01:00
parent b0c25a1a72
commit 097cd9cf02
4 changed files with 117 additions and 10 deletions

View File

@@ -26,6 +26,12 @@ Python interpreters that support it.
.. autoclass:: microdot.Response
:members:
``MultiDict`` class
~~~~~~~~~~~~~~~~~~~
.. autoclass:: microdot.MultiDict
:members:
``microdot_asyncio`` module
---------------------------

View File

@@ -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
View 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()