Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,26 +3,11 @@ os.environ["OMP_NUM_THREADS"] = "1"
|
|
| 3 |
os.environ["MKL_NUM_THREADS"] = "1"
|
| 4 |
|
| 5 |
import uvicorn
|
| 6 |
-
from
|
| 7 |
-
from fastapi.staticfiles import StaticFiles
|
| 8 |
-
from fastapi.middleware.cors import CORSMiddleware
|
| 9 |
-
|
| 10 |
-
app = FastAPI()
|
| 11 |
-
|
| 12 |
-
app.add_middleware(
|
| 13 |
-
CORSMiddleware,
|
| 14 |
-
allow_origins=["*"],
|
| 15 |
-
allow_methods=["*"],
|
| 16 |
-
allow_headers=["*"],
|
| 17 |
-
)
|
| 18 |
-
|
| 19 |
-
# Your API routes go here later
|
| 20 |
-
# @app.post("/patients/")
|
| 21 |
-
# @app.post("/analyze/")
|
| 22 |
-
|
| 23 |
-
# Serve React build — must be LAST
|
| 24 |
-
app.mount("/", StaticFiles(directory="dist", html=True), name="static")
|
| 25 |
|
| 26 |
if __name__ == "__main__":
|
| 27 |
-
uvicorn.run(
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
os.environ["MKL_NUM_THREADS"] = "1"
|
| 4 |
|
| 5 |
import uvicorn
|
| 6 |
+
from backend import app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
if __name__ == "__main__":
|
| 9 |
+
uvicorn.run(
|
| 10 |
+
app,
|
| 11 |
+
host="0.0.0.0",
|
| 12 |
+
port=int(os.environ.get("PORT", 7860))
|
| 13 |
+
)
|