https://github.com/Azure-Samples/flask-app-on-azure-functions/ https://docs.microsoft.com/en-us/samples/azure-samples/flask-app-on-azure-functions/azure-functions-python-create-flask-app/
I have not figured out how to activate this from npm
. venv/Scripts/activate
- npm install -g create-react-app react-scripts
- create-react-app
- Delete src and public folder
- Create client and public folder
- Client
- Components
- App.jsx
- Customers.jsx
- Home.jsx
- Styles
- globals.css index.js
- Components
- npm run eject
- Inside frontend/config/paths.js change appBuild to "resolveApp('../backend/static/react')"
- Inside frontend/config/webpack.config.js find and remove all static/ references
- Inside frontend/config/webapck.config.js add filename: "../../templates/index.html" to HTMLWebpackPlugin options object
- Inside frontend/public/index.html add <script>window.token = "{{token}}"</script> to the head
- We can now use {window.token} in our react app
- Inside frontend/package.json add "homepage": "static/react" to the object
- npm run build
- Open terminal as administrator
- pip install virtualenv
- virtualenv venv --python=python3.9.13
- . venv/Scripts/activate
- pip install -r requirements.txt
- func start
- Set debug to true when in dev and false when in prod (this captures change in hot reload and also swaps the mail server)
- cd frontend
- . ../backend/venv/bin/activate
- npm run dev
- http://localhost:3000/
(HMR with flask)[https://python-webpack-boilerplate.readthedocs.io/en/latest/live_reload/]