Divide the helper methods into three groups: 1. Internal functions that are specific to the API class but do not require access to self. These go in "api_helpers". 2. Functions that are used for the API class but may also be useful to higher-level or custom web frameworks building on Falcon. There are presently two such functions, both related to routing, so they go into a new module, "routing". These functions will be included in Falcon's reference documentation, and care must be taken to avoid introducing breaking changes to them in future versions of the framework. 3. Functions that only need access to self for performance reasons, which would otherwise reside in "api_helpers". These go inside the definition of the API class itself.
425 B
425 B
Routing
The falcon.routing module contains utilities used internally
by falcon.API to route requests. They are exposed here for
use by classes that inherit from falcon.API to implement
custom routing logic, and in anticipation of a future version of the
framework that will afford customization of routing via composition in
lieu of inheritance.
falcon.routing