Spaces:
Build error
Build error
Commit
·
066de16
1
Parent(s):
391ac5d
server is blocking reqeusts, trying to change cors arguments and stuff
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ app = Flask(
|
|
| 9 |
template_folder="templates",
|
| 10 |
)
|
| 11 |
|
| 12 |
-
CORS(app)
|
| 13 |
|
| 14 |
|
| 15 |
def not_valid(params: dict):
|
|
@@ -29,8 +29,6 @@ def not_valid(params: dict):
|
|
| 29 |
|
| 30 |
@app.route("/", methods=["POST"])
|
| 31 |
def index():
|
| 32 |
-
if request.method == "GET":
|
| 33 |
-
return render_template("index.html")
|
| 34 |
|
| 35 |
error_message = not_valid(params=request.json)
|
| 36 |
if error_message:
|
|
|
|
| 9 |
template_folder="templates",
|
| 10 |
)
|
| 11 |
|
| 12 |
+
CORS(app, origins="*")
|
| 13 |
|
| 14 |
|
| 15 |
def not_valid(params: dict):
|
|
|
|
| 29 |
|
| 30 |
@app.route("/", methods=["POST"])
|
| 31 |
def index():
|
|
|
|
|
|
|
| 32 |
|
| 33 |
error_message = not_valid(params=request.json)
|
| 34 |
if error_message:
|