This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
Can someone help me disable cors policy so other repls can access my database?
1 year ago
- what you're trying to do is ENABLE cors
and here is your code mate
from flask import * from flask_cors import CORS from replit import db app = Flask(__name__) cors = CORS(app) app.config['CORS_HEADERS'] = 'Content-Type' @app.route("/set/<name>/<data>/") def set(name, data): print(name + " = " + data) db[name] = data return "" @app.route("/get/<name>/") def get(name): return db[name] app.run(host="0.0.0.0", debug=True)