Liyew commited on
Commit
cd38583
·
verified ·
1 Parent(s): 5d3ceb7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -1,8 +1,22 @@
1
  from fastapi import FastAPI
2
  from outfit import router
3
  import uvicorn
4
- app = FastAPI()
 
 
 
 
 
 
 
 
 
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)