MCPcopy Create free account
hub / github.com/reactive-python/reactpy / configure

Function configure

src/py/reactpy/reactpy/backend/flask.py:61–82  ·  view source on GitHub ↗

Configure the necessary ReactPy routes on the given app. Parameters: app: An application instance component: A component constructor options: Options for configuring server behavior

(
    app: Flask, component: RootComponentConstructor, options: Options | None = None
)

Source from the content-addressed store, hash-verified

59
60# BackendType.configure
61def configure(
62 app: Flask, component: RootComponentConstructor, options: Options | None = None
63) -> None:
64 """Configure the necessary ReactPy routes on the given app.
65
66 Parameters:
67 app: An application instance
68 component: A component constructor
69 options: Options for configuring server behavior
70 """
71 options = options or Options()
72
73 api_bp = Blueprint(f"reactpy_api_{id(app)}", __name__, url_prefix=str(PATH_PREFIX))
74 spa_bp = Blueprint(
75 f"reactpy_spa_{id(app)}", __name__, url_prefix=options.url_prefix
76 )
77
78 _setup_single_view_dispatcher_route(api_bp, options, component)
79 _setup_common_routes(api_bp, spa_bp, options)
80
81 app.register_blueprint(api_bp)
82 app.register_blueprint(spa_bp)
83
84
85# BackendType.create_development_app

Callers 2

run_flask.pyFile · 0.90
run_fastapi.pyFile · 0.50

Calls 3

OptionsClass · 0.70
_setup_common_routesFunction · 0.70

Tested by

no test coverage detected