Integrate React app into Flask app Integrate React app into Flask app flask flask

Integrate React app into Flask app


It looks like create-react-app has instructions re: building for relative paths. So you can develop the React app as usual.

Then, when you are ready, you 'npm run build,' which creates a build folder that has all the assets needed for your single page app (html, bundled javascript, css, etc). You can copy that entire folder into the directory with the rest of your templates. Then your @app.route(/dynamic-part) can point to ./app/templates/build/index.html.