mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-10 01:17:42 +01:00
13 lines
No EOL
339 B
Python
13 lines
No EOL
339 B
Python
from aiohttp import web
|
|
|
|
async def handle(request):
|
|
name = request.match_info.get('name', "Anonymous")
|
|
text = "Hello, " + name
|
|
return web.Response(text=text)
|
|
|
|
app = web.Application()
|
|
app.add_routes([web.get('/', handle),
|
|
web.get('/{name}', handle)])
|
|
|
|
if __name__ == '__main__':
|
|
web.run_app(app, port="8000") |