Skip to content

Commit

Permalink
Update README and index.html to use app.add_routes
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Mar 21, 2018
1 parent 9dd9ecb commit 1cfa64f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ This is simple usage example:
text = "Hello, " + name
return web.Response(text=text)
async def wshandler(request):
async def wshandle(request):
ws = web.WebSocketResponse()
await ws.prepare(request)
Expand All @@ -96,9 +96,9 @@ This is simple usage example:
app = web.Application()
app.router.add_get('/echo', wshandler)
app.router.add_get('/', handle)
app.router.add_get('/{name}', handle)
app.add_routes([web.get('/', handle),
web.get('/echo', wshandle),
web.get('/{name}', handle)])
web.run_app(app)
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ Server example::
return web.Response(text=text)

app = web.Application()
app.router.add_get('/', handle)
app.router.add_get('/{name}', handle)
app.add_routes([web.get('/', handle),
web.get('/{name}', handle)])

web.run_app(app)

Expand Down
1 change: 1 addition & 0 deletions docs/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ Nikolay
noop
nowait
OAuth
Online
optimizations
os
outcoming
Expand Down

0 comments on commit 1cfa64f

Please sign in to comment.