diff --git a/weather_overlay/main.py b/weather_overlay/main.py index 8cd6ef6..14c7125 100644 --- a/weather_overlay/main.py +++ b/weather_overlay/main.py @@ -1,9 +1,18 @@ from fastapi import FastAPI, WebSocket, WebSocketDisconnect +from starlette.middleware.cors import CORSMiddleware import httpx import json app = FastAPI() +app.add_middleware( + CORSMiddleware, + allow_origins=["https://overlays.ramforth.net"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) + # OpenWeatherMap API Configuration OPENWEATHERMAP_API_KEY = "88764d3fd0fec25358ebce447f9f8d0b" OPENWEATHERMAP_URL = "http://api.openweathermap.org/data/2.5/weather"