Updated examples in-line with response docs

This commit is contained in:
Shawn Niederriter 2017-04-06 19:47:25 +00:00
parent c30437448b
commit 9d3bb4a37a
3 changed files with 3 additions and 3 deletions

View File

@ -10,7 +10,7 @@ async def fetch(session, url):
Use session object to perform 'get' request on url
"""
async with session.get(url) as result:
return await result.text()
return await result.json()
@app.route('/')

View File

@ -14,4 +14,4 @@ async def test(request):
if __name__ == '__main__':
app.run(host="0.0.0.0", port=8080)
app.run(host="0.0.0.0", port=8000)

View File

@ -12,7 +12,7 @@ async def test(request):
return response.json({"answer": "42"})
asyncio.set_event_loop(uvloop.new_event_loop())
server = app.create_server(host="0.0.0.0", port=8080)
server = app.create_server(host="0.0.0.0", port=8000)
loop = asyncio.get_event_loop()
task = asyncio.ensure_future(server)
signal(SIGINT, lambda s, f: loop.stop())