Ask coding questions

← Back to all posts
Can someone help me disable cors policy so other repls can access my database?
noah560

from flask import *
from replit import db

app = Flask(name)

@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)

Voters
noah560
Comments
hotnewtop
SixBeeps
noah560

@SixBeeps thanks

ch1ck3n
  1. what you're trying to do is ENABLE cors

and here is your code mate

noah560

@ch1ck3n thanks