Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,22 @@
|
|
1 |
from fastapi import FastAPI
|
2 |
from outfit import router
|
3 |
import uvicorn
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
app.include_router(router)
|
6 |
|
|
|
|
|
|
|
|
|
|
|
7 |
if __name__ == "__main__":
|
8 |
-
uvicorn.run("app:app", host="0.0.0.0", port=7860)
|
|
|
1 |
from fastapi import FastAPI
|
2 |
from outfit import router
|
3 |
import uvicorn
|
4 |
+
import os
|
5 |
+
|
6 |
+
# Define the app with custom docs URLs for Hugging Face compatibility
|
7 |
+
app = FastAPI(
|
8 |
+
title="Fashion Backend API",
|
9 |
+
docs_url="/docs",
|
10 |
+
redoc_url="/redoc"
|
11 |
+
)
|
12 |
+
|
13 |
+
# Include your outfit router
|
14 |
app.include_router(router)
|
15 |
|
16 |
+
@app.get("/")
|
17 |
+
def root():
|
18 |
+
return {"message": "FastAPI is running!"}
|
19 |
+
|
20 |
+
# Needed to launch the app on Hugging Face
|
21 |
if __name__ == "__main__":
|
22 |
+
uvicorn.run("app:app", host="0.0.0.0", port=7860)
|