Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,12 @@ app = FastAPI(
|
|
| 28 |
)
|
| 29 |
|
| 30 |
# Configure CORS
|
| 31 |
-
origins =
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
app.add_middleware(
|
| 33 |
CORSMiddleware,
|
| 34 |
allow_origins=origins,
|
|
@@ -37,6 +42,7 @@ app.add_middleware(
|
|
| 37 |
allow_headers=["*"],
|
| 38 |
)
|
| 39 |
|
|
|
|
| 40 |
# Initialize components
|
| 41 |
emotion_detector = EmotionDetector()
|
| 42 |
ai_insights = AIInsightGenerator()
|
|
|
|
| 28 |
)
|
| 29 |
|
| 30 |
# Configure CORS
|
| 31 |
+
origins = [
|
| 32 |
+
"https://aimirror15.netlify.app", # your frontend
|
| 33 |
+
"http://localhost:5173", # for local testing
|
| 34 |
+
"https://huggingface.co", # Hugging Face itself
|
| 35 |
+
]
|
| 36 |
+
|
| 37 |
app.add_middleware(
|
| 38 |
CORSMiddleware,
|
| 39 |
allow_origins=origins,
|
|
|
|
| 42 |
allow_headers=["*"],
|
| 43 |
)
|
| 44 |
|
| 45 |
+
|
| 46 |
# Initialize components
|
| 47 |
emotion_detector = EmotionDetector()
|
| 48 |
ai_insights = AIInsightGenerator()
|