# *Py - most simple aio microdot webserver
# Copyright by Anthony Vogelaar, Perth Scotland
# rev 0.10  2025-11-26  initial release

import	asyncio
from	microdot	import	Microdot

# ==================== webserver ========================

app = Microdot()

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

# ======================= main ==========================

# Three cooperative asyncio tasks
#    task #1: webserver
#    task #2: print '*' @ 1 Hz
async def main():
    asyncio.create_task(app.start_server(debug=True))	# task #1
    while True:											# task #2
        await asyncio.sleep(1)
        print('*', end='')


asyncio.run(main())
    
# ======================== end ===========================
