Linked Questions

Popular Questions

Get list of all routes defined in the Falcon app

Asked by At

I have RESTful routes in a Falcon app defined as below simplified codes. My question is how to get list of all routes with their mapped handlers?

My google search results in little-helpful rpages - one similar issue resolved for Flask app here but no page talking about Falcon.

api = falcon.API(middleware=middleware)
api.add_route('/v1/model_names1', SomeHandlerMappingResource1())
api.add_route('/v1/model_names2', SomeHandlerMappingResource2())

class SomeHandlerMappingResource1:
    def on_get(self, req, resp):
        pass # some biz logic of GET method
    def on_post(self, req, resp):
        pass # some biz logic of POST method
    # etc.

class SomeHandlerMappingResource2:
    pass # similar to handler resource 1 above 

Related Questions