Skip to content

Commit

Permalink
Merge pull request #30 from its-leofisher/29-cors
Browse files Browse the repository at this point in the history
Add CORs
  • Loading branch information
its-leofisher authored Sep 25, 2024
2 parents 3a32830 + 3099e8e commit 3e0a48e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from utils import rgb_to_hsv, discover_and_cache_devices, load_cached_device, retrieve_primary_device
import os
from dotenv import load_dotenv
from flask_cors import CORS

load_dotenv()

Expand All @@ -17,6 +18,7 @@

TARGET_BULB_ALIAS = retrieve_primary_device()
SLACK_ALLOWED_CHANNELS = {'CHANNEL_IDS'}
cors = CORS(app, resources={r"/v1/*": {"origins": "*"}})

async def set_bulb_color(bulb, hex_color, duration=None, blink=False):
red, green, blue = int(hex_color[1:3], 16), int(hex_color[3:5], 16), int(hex_color[5:7], 16)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
flask-cors==5.0.0
cryptography==42.0.7
exceptiongroup==1.2.2
Flask==3.0.3
Expand Down

0 comments on commit 3e0a48e

Please sign in to comment.