Skip to content

Commit 33e166e

Browse files
committed
Allow CORS
1 parent 70a20cc commit 33e166e

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ services:
2020
#PWC_INTERFACE: "auto"
2121

2222
## Enable/Disable LED interaction ##
23-
#PWC_LED: "ON"
23+
#PWC_LED: "on"
2424

2525
## Required system variables ##
2626
DBUS_SYSTEM_BUS_ADDRESS: "unix:path=/host/run/dbus/system_bus_socket"

src/requirements.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
Flask-Cors
12
Flask-RESTful
23
python-networkmanager
34
waitress

src/requirements.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ click==8.0.3
1111
dbus-python==1.2.18
1212
# via python-networkmanager
1313
flask==2.0.2
14-
# via flask-restful
14+
# via
15+
# flask-cors
16+
# flask-restful
17+
flask-cors==3.0.10
18+
# via -r requirements.in
1519
flask-restful==0.3.9
1620
# via -r requirements.in
1721
itsdangerous==2.0.1
@@ -26,6 +30,7 @@ pytz==2021.3
2630
# via flask-restful
2731
six==1.16.0
2832
# via
33+
# flask-cors
2934
# flask-restful
3035
# python-networkmanager
3136
waitress==2.0.0

src/run.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from config import host
1313
from config import port
1414
from flask import Flask
15+
from flask_cors import CORS
1516
from flask_restful import Api
1617
from resources.system_routes import system_health_check
1718
from resources.wifi_routes import wifi_connect
@@ -25,6 +26,9 @@
2526
# Create Flask app instance
2627
app = Flask(__name__)
2728

29+
# Allow CORS
30+
CORS(app)
31+
2832
# Load Flask-Restful API
2933
api = Api(app, errors=errors)
3034

0 commit comments

Comments
 (0)