Skip to content

Commit

Permalink
Merge branch 'staging' into update-vrs
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Aug 7, 2024
2 parents e1d243a + 91e04e7 commit 645105d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ You can run:
yarn install --ignore-engines
```

Next, run the following commands:

```
yarn build
mv build/ ../server/curfu/build
```

Then start the development server:

```commandline
Expand Down
11 changes: 10 additions & 1 deletion server/src/curfu/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,15 @@ async def lifespan(app: FastAPI) -> AsyncGenerator:


def serve_react_app(app: FastAPI) -> FastAPI:
"""Wrap application initialization in Starlette route param converter.
"""Wrap application initialization in Starlette route param converter. This ensures
that the static web client files can be served from the backend.
Client source must be available at the location specified by `BUILD_DIR` in a
production environment. However, this may not be necessary during local development,
so the `RuntimeError` is simply caught and logged.
For the live service, `.ebextensions/01_build.config` includes code to build a
production version of the client and move it to the proper location.
:param app: FastAPI application instance
:return: application with React frontend mounted
Expand All @@ -111,6 +119,7 @@ async def serve_react_app(request: Request, full_path: str) -> TemplateResponse:
and handle all client requests, and will 404 on any non-server-defined paths.
This function reroutes those otherwise failed requests against the React-Router
client, allowing it to redirect the client to the appropriate location.
:param request: client request object
:param full_path: request path
:return: Starlette template response object
Expand Down

0 comments on commit 645105d

Please sign in to comment.