Update main.py
Browse files
main.py
CHANGED
|
@@ -67,12 +67,8 @@ app = FastAPI()
|
|
| 67 |
# Add CORS middleware
|
| 68 |
app.add_middleware(
|
| 69 |
CORSMiddleware,
|
| 70 |
-
allow_origins=[
|
| 71 |
-
|
| 72 |
-
"http://127.0.0.1:3000",
|
| 73 |
-
os.getenv("FRONTEND_URL", "*") # Allow production frontend
|
| 74 |
-
],
|
| 75 |
-
allow_credentials=True,
|
| 76 |
allow_methods=["*"],
|
| 77 |
allow_headers=["*"],
|
| 78 |
)
|
|
@@ -97,6 +93,11 @@ SCOPES = [
|
|
| 97 |
'openid'
|
| 98 |
]
|
| 99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
# Set these in your Hugging Face Space secrets!
|
| 101 |
GOOGLE_REDIRECT_URI = os.getenv("GOOGLE_REDIRECT_URI", "http://localhost:8000/auth/callback")
|
| 102 |
FRONTEND_URL = os.getenv("FRONTEND_URL", "http://localhost:3000")
|
|
|
|
| 67 |
# Add CORS middleware
|
| 68 |
app.add_middleware(
|
| 69 |
CORSMiddleware,
|
| 70 |
+
allow_origins=["*"], # Allow all for now to debug connectivity
|
| 71 |
+
allow_credentials=False, # Standard fetch doesn't need this, and "*" requires False
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
allow_methods=["*"],
|
| 73 |
allow_headers=["*"],
|
| 74 |
)
|
|
|
|
| 93 |
'openid'
|
| 94 |
]
|
| 95 |
|
| 96 |
+
# Health check for deployment testing
|
| 97 |
+
@app.get("/health")
|
| 98 |
+
def health_check():
|
| 99 |
+
return {"status": "healthy", "version": "1.0.1"}
|
| 100 |
+
|
| 101 |
# Set these in your Hugging Face Space secrets!
|
| 102 |
GOOGLE_REDIRECT_URI = os.getenv("GOOGLE_REDIRECT_URI", "http://localhost:8000/auth/callback")
|
| 103 |
FRONTEND_URL = os.getenv("FRONTEND_URL", "http://localhost:3000")
|