Skip to content

Commit

Permalink
add CORS setup
Browse files Browse the repository at this point in the history
  • Loading branch information
wuttinanhi committed Nov 12, 2022
1 parent 7c2543d commit a137772
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from settings.blueprint import blueprint as settings_blueprint
from settings.service import SettingService
from user.blueprint import blueprint as user_blueprint
from flask_cors import CORS

# load env
load_env()
Expand All @@ -36,6 +37,8 @@
__name__, static_folder="static", template_folder="static", static_url_path=""
)

# CORS setup
CORS(app)

# create logger
app.logger = create_logger(app)
Expand All @@ -50,6 +53,8 @@
)




# initialize database
init_db()

Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ commonmark==0.9.1
Deprecated==1.2.13
dill==0.3.5.1
Flask==2.2.2
Flask-Cors==3.0.10
Flask-Limiter==2.7.0
Flask-SocketIO==5.3.1
greenlet==1.1.3
Expand Down Expand Up @@ -38,6 +39,7 @@ python-engineio==4.3.4
python-socketio==5.7.1
requests==2.28.1
rich==12.6.0
six==1.16.0
SQLAlchemy==1.4.41
stripe==4.1.0
toml==0.10.2
Expand Down

0 comments on commit a137772

Please sign in to comment.