Page 1 of 1

Microdot error

Posted: Thu Feb 10, 2022 4:48 am
by jbar
When running an example from the microdot_asyncio module I get the following error. Only change I made to the example code was to replace the example code from 'import asyncio' to 'import uasyncio as asyncio'.


Traceback (most recent call last):
File "/lib/microdot_asyncio.py", line 245, in dispatch_request
File "/lib/microdot_asyncio.py", line 287, in _invoke_handler
TypeError: function takes 0 positional arguments but 1 were given
GET / 500

Code: Select all

#import asyncio
# I changed to:
import uasyncio as asyncio

from microdot_asyncio import Microdot

app = Microdot()

@app.route('/')
async def index():
    return 'Hello, world!'

async def main():
    await app.start_server(debug=True)

asyncio.run(main())