Skip to content

Commit

Permalink
Add CORS to all routes.
Browse files Browse the repository at this point in the history
  • Loading branch information
scossu committed Jul 19, 2024
1 parent ccafaee commit 5729ca4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Core application dependencies.
flask>=2.3,<3
flask-cors>=4.0,<5
python-dotenv>=1.0,<2
pyyaml>=6.0,<7
uwsgi>=2.0,<2.1
2 changes: 2 additions & 0 deletions scriptshifter/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from smtplib import SMTP

from flask import Flask, jsonify, render_template, request
from flask_cors import CORS

from scriptshifter import EMAIL_FROM, EMAIL_TO, SMTP_HOST, SMTP_PORT
from scriptshifter.exceptions import ApiError
Expand All @@ -28,6 +29,7 @@ def create_app():
"JSON_AS_ASCII": False,
"JSONIFY_PRETTYPRINT_REGULAR": True,
})
CORS(app)

return app

Expand Down

0 comments on commit 5729ca4

Please sign in to comment.