Configure an application instance to display the given component
(
app: Sanic[Any, Any],
component: RootComponentConstructor,
options: Options | None = None,
)
| 48 | |
| 49 | # BackendType.configure |
| 50 | def 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 |
no test coverage detected