Skip to content

Commit

Permalink
CORS allowed for REST APIs. (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZdenekM authored May 22, 2020
1 parent 3cb25bb commit 2df5c21
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arcor2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.2
0.4.3
2 changes: 2 additions & 0 deletions arcor2/nodes/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from apispec import APISpec # type: ignore
from apispec_webframeworks.flask import FlaskPlugin # type: ignore
from flask import Flask, send_file
from flask_cors import CORS # type: ignore
from flask_swagger_ui import get_swaggerui_blueprint # type: ignore

import arcor2
Expand Down Expand Up @@ -42,6 +43,7 @@
)

app = Flask(__name__)
CORS(app)


def _publish(project_id: str):
Expand Down
2 changes: 2 additions & 0 deletions arcor2/nodes/execution_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from apispec import APISpec # type: ignore
from apispec_webframeworks.flask import FlaskPlugin # type: ignore
from flask import Flask, jsonify, request, send_file
from flask_cors import CORS # type: ignore
from flask_swagger_ui import get_swaggerui_blueprint # type: ignore
from werkzeug.utils import secure_filename

Expand All @@ -34,6 +35,7 @@
)

app = Flask(__name__)
CORS(app)


# TODO find out why long-lasting connection is not possible (it is getting disconnected after few minutes)
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
'flask_swagger_ui',
'websocket-client',
'pyyaml', # dependency of apispec, for some reason not installed automatically...
'Pillow'
'Pillow',
'flask-cors'
],
extras_require={
'test': [
Expand Down

0 comments on commit 2df5c21

Please sign in to comment.