timfocus commited on
Commit
2de1405
·
verified ·
1 Parent(s): c5d2745

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -3,6 +3,7 @@ from fastapi.responses import FileResponse
3
  import csv
4
  import random
5
  import datetime
 
6
 
7
  app = FastAPI()
8
 
@@ -71,4 +72,8 @@ def download_csv():
71
 
72
  @app.get("/")
73
  def root():
74
- return {"message": "Welcome to the Shipping CSV Generator API! Use /generate-csv to download the file."}
 
 
 
 
 
3
  import csv
4
  import random
5
  import datetime
6
+ import uvicorn
7
 
8
  app = FastAPI()
9
 
 
72
 
73
  @app.get("/")
74
  def root():
75
+ return {"message": "Welcome to the Shipping CSV Generator API! Use /generate-csv to download the file."}
76
+
77
+ # Ensure FastAPI starts correctly on Hugging Face
78
+ if __name__ == "__main__":
79
+ uvicorn.run(app, host="0.0.0.0", port=7860)