Skip to content

Commit 64910ed

Browse files
committed
add cors to flask
1 parent 540851d commit 64910ed

File tree

3 files changed

+30
-19
lines changed

3 files changed

+30
-19
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ python-dotenv = "*"
1212
sympy = "*"
1313
latex2sympy2 = "*"
1414
flask = "*"
15+
flask-cors = "*"
1516

1617
[dev-packages]
1718
gunicorn = "*"

Pipfile.lock

Lines changed: 27 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from flask import Flask, request
22
from ..haystack.pipeline.pipeline import query
3+
from flask_cors import CORS
34

45
app = Flask(__name__)
6+
CORS(app)
57

68
@app.route("/api/qna")
79
def qna():

0 commit comments

Comments
 (0)