Add CORS middleware to main.py for weather_overlay

This commit is contained in:
Ramforth
2025-10-31 19:00:00 +01:00
parent 02290744b7
commit f6b312478e

View File

@@ -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"