A basic example of using a React application with Starlette.
Requirements: Python 3.6+
-
Install
starlette
anduvicorn
from the requirements file in the backend directory:pip install -r requirements.txt --upgrade
-
Run the application using
uvicorn
:python app.py
Uvicorn is the ASGI server used to run the application in this example, however other ASGI servers, such as Hypercorn and Daphne could be used as well.
The React app was initially created using the create-react-app
command.
-
Install the dependencies:
yarn install
-
Run the server:
yarn start