diff --git a/main.py b/main.py new file mode 100644 index 0000000..ccdbd05 --- /dev/null +++ b/main.py @@ -0,0 +1,22 @@ +import os +import uvicorn +from datetime import datetime +from fastapi import FastAPI + +app = FastAPI(title="Cosmos Orbit FastAPI Starter") + +@app.get("/") +def read_root(): + return { + "status": "online", + "app": "Cosmos Orbit — Python FastAPI Server", + "timestamp": datetime.utcnow().isoformat() + } + +@app.get("/health") +def health(): + return {"status": "healthy"} + +if __name__ == "__main__": + port = int(os.environ.get("PORT", 8000)) + uvicorn.run("main:app", host="0.0.0.0", port=port) diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..bf28ec1 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +fastapi>=0.110.0 +uvicorn>=0.28.0