Expanding Your App Subroutes Let’s start with a simple way to combine routes that share a common endpoint. For example, lets say we need routes for /base/first , /base/second , /base/third . The crude way of achieving this would be to explicitly write out each route with the /base route, like so: app . route( '/base/first' ) def first (request): # ... app . route( '/base/second' ) def second (request): # ... app . route( '/base/third' ) def third (request): # ... This is valid code, but there’s simpler syntax that can help reduce some common human errors like misspellings. The subroute function helps make the code more legible as well as simpler. with app . subroute( '/base' ) as sub: @sub.route ( '/first' ) def first (request): return 'first' @sub.route ( '/second' ) def second (request): return 'second' @sub.route ( '/t...
Concurrent, async design patterns in Python (mostly). Tutorials in twisted, tornado, uvloop, asyncio.