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
)
| 59 | |
| 60 | # BackendType.configure |
| 61 | def 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 |
no test coverage detected