Add CORS middleware to main.py for weather_overlay
This commit is contained in:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user