Spaces:
Paused
Paused
File size: 918 Bytes
8856ca8 f35f208 8856ca8 f35f208 679b18c 8856ca8 f35f208 5d274cb f35f208 679b18c 8856ca8 f35f208 8856ca8 679b18c 5d274cb 679b18c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
import sys
print("Python Version:", sys.version)
print("Starting application...")
from fastapi import FastAPI
print("FastAPI imported successfully")
app = FastAPI(
title="Minimal Test API",
version="1.0.0",
default_response_class=None # Disable automatic response serialization
)
print("FastAPI app created")
@app.get("/")
async def root():
return {"message": "Server is running"}
@app.on_event("startup")
async def startup_event():
print("FastAPI startup event triggered")
print("Routes defined")
if __name__ == "__main__":
print("Starting uvicorn server...")
import uvicorn
config = uvicorn.Config(
"main.app:app",
host="0.0.0.0",
port=7680,
workers=1,
log_level="info",
reload=False,
proxy_headers=False,
server_header=False,
date_header=False
)
server = uvicorn.Server(config)
server.run() |