Route
Route base class for the ODIN server.
Tim Nicholls, STFC Application Engineering
Route
Bases: object
Base class for server routes.
This class defines a simple container that can be initialised with URLspec-formatted handlers, i.e. tuples containing a URL pattern and an associated RequestHandler subclass to be invoked
Source code in src/odin_control/http/routes/route.py
__init__()
add_handler(handler)
Add a handler to the route.
This method as a handler to the route, using a URLspec-formtted tuple.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
handler
|
a URLspec-formatted tuple, i.e. ( |
required |
Source code in src/odin_control/http/routes/route.py
get_handlers()
Return a list of handlers.
This method returns a list of handlers currently present in the Route object.