23 lines
519 B
Python
23 lines
519 B
Python
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)
|