Compare commits

..

No commits in common. '1b2592ed3288469ba460e9dc33862a2b7e9d12a8' and '25cd1944e1672b09aec6a88ad0214a0ef26dcbcd' have entirely different histories.

  1. 5
      demo/routes.py
  2. 3
      demo/views/frontend.py
  3. 9
      entry.py

@ -1,6 +1,7 @@
from .views import frontend
import aiohttp
def setup_routes(app):
app.router.add_routes([aiohttp.web.get('/', frontend.index), aiohttp.web.post('/button-clicked', frontend.button_clicked)])
def setup_routes(app):
app.router.add_routes(
[aiohttp.web.get('/', frontend.index), aiohttp.web.post('/button-clicked', frontend.button_clicked)])

@ -3,11 +3,10 @@ import aiohttp
from aiohttp_jinja2 import template
@template('index.html')
async def index(request):
return {}
async def button_clicked(request):
return aiohttp.web.json_response({'result':'Button was clicked'})
return aiohttp.web.json_response({'result': 'Button was clicked'})

@ -1,14 +1,7 @@
import aiohttp
from demo import create_app
app = create_app()
if __name__ == '__main__':
aiohttp.web.run_app(app)
aiohttp.web.run_app(app)

Loading…
Cancel
Save