MCPcopy Index your code
hub / github.com/plotly/dash / add_url_rule

Method add_url_rule

dash/backends/_fastapi.py:345–364  ·  view source on GitHub ↗
(
        self,
        rule: str,
        view_func: Callable[..., Any] | str,
        endpoint: str | None = None,
        methods: list[str] | None = None,
        include_in_schema: bool = False,
    )

Source from the content-addressed store, hash-verified

343 traceback.print_exc()
344
345 def add_url_rule(
346 self,
347 rule: str,
348 view_func: Callable[..., Any] | str,
349 endpoint: str | None = None,
350 methods: list[str] | None = None,
351 include_in_schema: bool = False,
352 ):
353 if rule == "":
354 rule = "/"
355 if isinstance(view_func, str):
356 # Wrap string or sync function to async FastAPI handler
357 view_func = self._html_response_wrapper(view_func)
358 self.server.add_api_route(
359 rule,
360 view_func,
361 methods=methods or ["GET"],
362 name=endpoint,
363 include_in_schema=include_in_schema,
364 )
365
366 def before_request(self, func: Callable[[], Any] | None):
367 if func is not None:

Callers 1

_setup_catchallMethod · 0.95

Calls 1

Tested by

no test coverage detected