(options: Options)
| 111 | |
| 112 | |
| 113 | def _setup_common_routes(options: Options) -> _RouteHandlerSpecs: |
| 114 | return [ |
| 115 | ( |
| 116 | rf"{MODULES_PATH}/(.*)", |
| 117 | StaticFileHandler, |
| 118 | {"path": str(REACTPY_WEB_MODULES_DIR.current)}, |
| 119 | ), |
| 120 | ( |
| 121 | rf"{ASSETS_PATH}/(.*)", |
| 122 | StaticFileHandler, |
| 123 | {"path": str(CLIENT_BUILD_DIR / "assets")}, |
| 124 | ), |
| 125 | ] + ( |
| 126 | [ |
| 127 | ( |
| 128 | r"/(.*)", |
| 129 | IndexHandler, |
| 130 | {"index_html": read_client_index_html(options)}, |
| 131 | ), |
| 132 | ] |
| 133 | if options.serve_index_route |
| 134 | else [] |
| 135 | ) |
| 136 | |
| 137 | |
| 138 | def _add_handler( |
no test coverage detected