Spaces:
Runtime error
Runtime error
fix CORS
Browse files- app.py +1 -0
- templates/index.html +1 -1
app.py
CHANGED
@@ -18,6 +18,7 @@ def home():
|
|
18 |
|
19 |
|
20 |
@app.route('/summarize', methods=['POST'])
|
|
|
21 |
def recommend():
|
22 |
if request.method == "POST":
|
23 |
# Get form data
|
|
|
18 |
|
19 |
|
20 |
@app.route('/summarize', methods=['POST'])
|
21 |
+
@cross_origin()
|
22 |
def recommend():
|
23 |
if request.method == "POST":
|
24 |
# Get form data
|
templates/index.html
CHANGED
@@ -194,7 +194,7 @@
|
|
194 |
type: 'POST',
|
195 |
url: '/summarize',
|
196 |
data: JSON.stringify(data),
|
197 |
-
headers: {'Access-Control-Allow-Origin':'*'},
|
198 |
contentType: "application/json",
|
199 |
dataType: 'json',
|
200 |
xhrFields: {
|
|
|
194 |
type: 'POST',
|
195 |
url: '/summarize',
|
196 |
data: JSON.stringify(data),
|
197 |
+
headers: {'Access-Control-Allow-Origin': '*'},
|
198 |
contentType: "application/json",
|
199 |
dataType: 'json',
|
200 |
xhrFields: {
|