Configure Contrast Falcon middleware for the Python agent
The Falcon middleware is a WSGI middleware which must be configured as follows:
import falcon
# Create a Falcon app
_app = falcon.API()
# Create a Falcon view endpoint and register the route
home = Home()
_app.add_route('/home', home)
# Wrap the Falcon app in the Contrast middleware
# NOTE: this must happen after route registration
from contrast.agent.middlewares.falcon_middleware import FalconMiddleware as ContrastMiddleware
app = ContrastMiddleware(_app)