Created
March 7, 2019 12:33
-
-
Save theruziev/c97e5e51a9f7393a7e29c5d17a098a1f to your computer and use it in GitHub Desktop.
main.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)]) | |
app.router.add_static("/prefix", "./static") | |
if __name__ == '__main__': | |
web.run_app(app) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment