MCPcopy Index your code
hub / github.com/reactive-python/reactpy / configure

Function configure

src/py/reactpy/reactpy/backend/sanic.py:50–64  ·  view source on GitHub ↗

Configure an application instance to display the given component

(
    app: Sanic[Any, Any],
    component: RootComponentConstructor,
    options: Options | None = None,
)

Source from the content-addressed store, hash-verified

48
49# BackendType.configure
50def configure(
51 app: Sanic[Any, Any],
52 component: RootComponentConstructor,
53 options: Options | None = None,
54) -> None:
55 """Configure an application instance to display the given component"""
56 options = options or Options()
57
58 spa_bp = Blueprint(f"reactpy_spa_{id(app)}", url_prefix=options.url_prefix)
59 api_bp = Blueprint(f"reactpy_api_{id(app)}", url_prefix=str(PATH_PREFIX))
60
61 _setup_common_routes(api_bp, spa_bp, options)
62 _setup_single_view_dispatcher_route(api_bp, component, options)
63
64 app.blueprint([spa_bp, api_bp])
65
66
67# BackendType.create_development_app

Callers 3

run_sanic.pyFile · 0.90
main.pyFile · 0.90
make_appFunction · 0.90

Calls 3

OptionsClass · 0.70
_setup_common_routesFunction · 0.70

Tested by

no test coverage detected