Skip to content

Commit

Permalink
Drop using flask-cors (TODO use CORSMiddleware)
Browse files Browse the repository at this point in the history
  • Loading branch information
juhoinkinen committed Nov 15, 2023
1 parent 5d7ec95 commit 067983b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 2 additions & 4 deletions annif/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ def create_flask_app(config_name: str | None = None) -> Flask:

def create_app(config_name: str | None = None) -> Flask:
"""Create a Connexion app to be used for the API."""
# 'cxapp' here is the Connexion application that has a normal Flask app
# as a property (cxapp.app)
import connexion
from flask_cors import CORS

# from flask_cors import CORS # TODO Use CORSMiddleware
import annif.registry

# from annif.openapi.validation import CustomRequestBodyValidator # TODO Re-enable
Expand All @@ -55,7 +53,7 @@ def create_app(config_name: str | None = None) -> Flask:
cxapp.add_api("annif.yaml") # validator_map=validator_map)

# add CORS support
CORS(cxapp.app)
# CORS(cxapp.app)

if cxapp.app.config["INITIALIZE_PROJECTS"]:
annif.registry.initialize_projects(cxapp.app)
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ classifiers=[
python = ">=3.8,<3.12"

connexion = {version = "3.0.*", extras = ["flask","uvicorn", "swagger-ui"]}
flask-cors = "4.0.*"
click = "8.1.*"
click-log = "0.4.*"
joblib = "1.3.*"
Expand Down

0 comments on commit 067983b

Please sign in to comment.