Skip to content

Commit

Permalink
feat: add flask-cors
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Rodriguez authored and Diego Rodriguez committed Jul 19, 2023
1 parent 127ad95 commit 7b1bfa6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
16 changes: 15 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ returns = "^0.19.0"
dependency-injector = {version = "^4.41.0", extras = ["yaml"]}
db-plugins = { git = "https://[email protected]/alercebroker/db-plugins", tag = "3.0.0" }
ralidator_flask = { git = "https://[email protected]/alercebroker/ralidator-flask", rev = "50825f9"}
flask-cors = "^4.0.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.4.0"
Expand Down
2 changes: 2 additions & 0 deletions src/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from api.resources.classifier.classifier import api as classifier
from api.extensions import prometheus_metrics
from api.extensions import ralidator
from flask_cors import CORS
import os
import logging
from api.callbacks import after_request, before_request
Expand All @@ -36,6 +37,7 @@ def create_app(config_path):
app.logger.handlers = gunicorn_logger.handlers
app.logger.setLevel(os.getenv("LOG_LEVEL", gunicorn_logger.level))
# set up extensions
CORS(app)
ralidator.init_app(app)
prometheus_metrics.init_app(app)

Expand Down

0 comments on commit 7b1bfa6

Please sign in to comment.