A dummy app that has a React PWA and a Flask Server
- Create a venv/ folder
python3 -m venv venv
- Install all needed dependencies from dependencies.txt
pip3 install -r dependencies.txt
- In the pwa/ folder, run the following commands
npm install
npm run build
- run the Flask server
python3 run.py
- To run the React dev server,
cd pwa/
npm run start
- All AJAX requests from React are to start with route /api
e.g: /api/hello
- React application can be accessed on localhost:8080 (react dev server) or 0.0.0.0:5000 (flask)
- You need not run the react dev server if you are using flask. Just make sure you npm run build to use the latest version of the PWA