Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,22 +1,16 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.staticfiles import StaticFiles
|
| 3 |
import uvicorn
|
| 4 |
-
import os
|
| 5 |
|
| 6 |
-
# Initialize FastAPI app
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
app.
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
if os.environ.get("ENVIRONMENT") == "development":
|
| 15 |
-
# Start React development server
|
| 16 |
-
os.system("cd frontend && npm start &")
|
| 17 |
-
|
| 18 |
-
# Start FastAPI server
|
| 19 |
-
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 20 |
|
| 21 |
if __name__ == "__main__":
|
| 22 |
-
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from fastapi.staticfiles import StaticFiles
|
| 3 |
import uvicorn
|
|
|
|
| 4 |
|
|
|
|
| 5 |
app = FastAPI()
|
| 6 |
|
| 7 |
+
# Add your API routes here
|
| 8 |
+
@app.get("/api/health")
|
| 9 |
+
def health_check():
|
| 10 |
+
return {"status": "ok"}
|
| 11 |
|
| 12 |
+
# Mount frontend files - we'll set this up after building
|
| 13 |
+
app.mount("/", StaticFiles(directory="frontend/build", html=True), name="static")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
if __name__ == "__main__":
|
| 16 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|