Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,12 +21,17 @@ logger = logging.getLogger(__name__)
|
|
| 21 |
# Add CORS middleware
|
| 22 |
app.add_middleware(
|
| 23 |
CORSMiddleware,
|
| 24 |
-
allow_origins=["*"], # Update with Framer domain in production
|
| 25 |
allow_credentials=True,
|
| 26 |
allow_methods=["*"],
|
| 27 |
allow_headers=["*"],
|
| 28 |
)
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
# Global flag to prevent multiple downloads
|
| 31 |
MODEL_DOWNLOADED = False
|
| 32 |
|
|
|
|
| 21 |
# Add CORS middleware
|
| 22 |
app.add_middleware(
|
| 23 |
CORSMiddleware,
|
| 24 |
+
allow_origins=["*"], # Update with your Framer domain in production
|
| 25 |
allow_credentials=True,
|
| 26 |
allow_methods=["*"],
|
| 27 |
allow_headers=["*"],
|
| 28 |
)
|
| 29 |
|
| 30 |
+
# Add a root endpoint to confirm the app is running
|
| 31 |
+
@app.get("/")
|
| 32 |
+
async def root():
|
| 33 |
+
return {"message": "Welcome to the Face Swap API! Use /swap-face/ to swap faces or /docs to test the API."}
|
| 34 |
+
|
| 35 |
# Global flag to prevent multiple downloads
|
| 36 |
MODEL_DOWNLOADED = False
|
| 37 |
|