MCPcopy Create free account
hub / github.com/encode/starlette / CustomRoute

Class CustomRoute

tests/middleware/test_opentelemetry.py:400–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398 _, exporter = tracer_provider
399
400 class CustomRoute(BaseRoute):
401 def matches(self, scope: Scope) -> tuple[Match, Scope]:
402 return Match.FULL, {}
403
404 async def handle(self, scope: Scope, receive: Receive, send: Send) -> None:
405 await PlainTextResponse("custom")(scope, receive, send)
406
407 app = Starlette(routes=[CustomRoute()], middleware=[Middleware(OpenTelemetryMiddleware)])
408

Calls

no outgoing calls