CORS errors with Flask and gevent CORS errors with Flask and gevent flask flask

CORS errors with Flask and gevent


There is a flask snippet Decorator for the HTTP Access Control, you can use @crossdomain(origin='*') decorator.


Simplest way is to use flask-cors plugin

Install using pip

pip install -U flask-cors

Sample Code

app = Flask(__name__)cors = CORS(app, resources={r"/api/*": {"origins": "*"}})@app.route("/api/v1/users")def list_users():  return "user example"

For documentationh head over here flask-cors documentation.