Spaces:
Paused
Paused
Commit
·
679b18c
1
Parent(s):
8856ca8
New Dockerfile, still dummy app, testing minimal req file. Fixed REAMDME v6
Browse files- main/app.py +21 -4
main/app.py
CHANGED
|
@@ -5,21 +5,38 @@ print("Starting application...")
|
|
| 5 |
from fastapi import FastAPI
|
| 6 |
print("FastAPI imported successfully")
|
| 7 |
|
| 8 |
-
app = FastAPI(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
print("FastAPI app created")
|
| 10 |
|
| 11 |
@app.get("/")
|
| 12 |
async def root():
|
| 13 |
return {"message": "Server is running"}
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
print("Routes defined")
|
| 16 |
|
| 17 |
if __name__ == "__main__":
|
| 18 |
print("Starting uvicorn server...")
|
| 19 |
import uvicorn
|
| 20 |
-
|
|
|
|
| 21 |
"main.app:app",
|
| 22 |
host="0.0.0.0",
|
| 23 |
port=7680,
|
| 24 |
-
workers=1
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
from fastapi import FastAPI
|
| 6 |
print("FastAPI imported successfully")
|
| 7 |
|
| 8 |
+
app = FastAPI(
|
| 9 |
+
title="Minimal Test API",
|
| 10 |
+
version="1.0.0",
|
| 11 |
+
default_response_class=None # Disable automatic response serialization
|
| 12 |
+
)
|
| 13 |
print("FastAPI app created")
|
| 14 |
|
| 15 |
@app.get("/")
|
| 16 |
async def root():
|
| 17 |
return {"message": "Server is running"}
|
| 18 |
|
| 19 |
+
@app.on_event("startup")
|
| 20 |
+
async def startup_event():
|
| 21 |
+
print("FastAPI startup event triggered")
|
| 22 |
+
|
| 23 |
print("Routes defined")
|
| 24 |
|
| 25 |
if __name__ == "__main__":
|
| 26 |
print("Starting uvicorn server...")
|
| 27 |
import uvicorn
|
| 28 |
+
|
| 29 |
+
config = uvicorn.Config(
|
| 30 |
"main.app:app",
|
| 31 |
host="0.0.0.0",
|
| 32 |
port=7680,
|
| 33 |
+
workers=1,
|
| 34 |
+
log_level="info",
|
| 35 |
+
reload=False,
|
| 36 |
+
proxy_headers=False,
|
| 37 |
+
server_header=False,
|
| 38 |
+
date_header=False
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
server = uvicorn.Server(config)
|
| 42 |
+
server.run()
|