Spaces:
Paused
Paused
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") | |
async def root(): | |
return {"message": "Server is running"} | |
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() |