added CORS

This commit is contained in:
Luka Kavčič 2022-06-14 18:47:32 +02:00
parent ee81194e58
commit a199ab5750
2 changed files with 40 additions and 0 deletions

View File

@ -18,8 +18,11 @@ import random
import redis
from flask import Flask, Response, request
from flask_cors import CORS
app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})
redis = redis.Redis(host='localhost', port=6379, db=0)
URL = "//plugins.lexonomy.cjvt.si"

37
requirements.txt Normal file
View File

@ -0,0 +1,37 @@
#
# This file is autogenerated by pip-compile with python 3.8
#
async-timeout==4.0.2
# via redis
click==8.1.3
# via flask
deprecated==1.2.13
# via redis
flask==2.1.2
# via
# -r requirements.in
# flask-cors
flask-cors==3.0.10
# via -r requirements.in
importlib-metadata==4.11.4
# via flask
itsdangerous==2.1.2
# via flask
jinja2==3.1.2
# via flask
markupsafe==2.1.1
# via jinja2
packaging==21.3
# via redis
pyparsing==3.0.9
# via packaging
redis==4.3.3
# via -r requirements.in
six==1.16.0
# via flask-cors
werkzeug==2.1.2
# via flask
wrapt==1.14.1
# via deprecated
zipp==3.8.0
# via importlib-metadata