I have a typical WSGI application like so:
app = webapp2.WSGIApplication([
('/site/path/one', 'package.module.ClassOne'),
('/site/path/two', 'package.module.ClassTwo'),
('/site/path/three', 'package.module.ClassThree'),
])
I would like to be able to retrieve the list of routes later in my application, say for example, in ClassOne:
class ClassOne(webapp2.RequestHandler):
def get(self):
print ''' list of routes (e.g. '/site/path/one', '/site/path/two', etc.) '''
It looks like WSGIApplication has a router property
Router has
Your wsgiApplication instance is a property of your
webapp2.RequestHandlerso I think
request.app.routerSo hopefully there is a more straighforward way but if not the above should worK?
Webapp2 had really great searchable source code available at http://webapp2.readthedocs.io/en/latest/