Serve React production App (local server) through Flask-Python

Yes it's possible to do it in flask with static folder/files. You need to create a folder which is called static in your project. Imagine this folder structure:

├── server/
└── static/
    ├── css/
    ├── dist/
    ├── images/
    └── js/
        index.html

For your react app the only thing you need do is to build npm run build.

In flask you should set this static folder in order to be used. You need in a simplified version this:

# server.py
from flask import Flask, render_template

app = Flask(__name__, static_folder="../static/dist", template_folder="../static")

@app.route("/")
def index():
    return render_template("index.html")

@app.route("/hello")
def hello():
    return "Hello World!”

if __name__ == "__main__":
    app.run()

So the root path / will show react. The /hello path will show the response from flask.