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

Function _setup_common_routes

src/py/reactpy/reactpy/backend/tornado.py:113–135  ·  view source on GitHub ↗
(options: Options)

Source from the content-addressed store, hash-verified

111
112
113def _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
138def _add_handler(

Callers 1

configureFunction · 0.70

Calls 1

read_client_index_htmlFunction · 0.90

Tested by

no test coverage detected