Spaces:
Sleeping
Sleeping
ARYANPATEL-BIT commited on
Commit ·
eef3ce9
1
Parent(s): 024253a
Feat created a better version of app.py
Browse files- server/app.py +11 -3
server/app.py
CHANGED
|
@@ -2,7 +2,15 @@
|
|
| 2 |
FastAPI application entry point for the DevOps/FinOps OpenEnv Environment.
|
| 3 |
|
| 4 |
This module creates an HTTP server exposing the cloud optimization
|
| 5 |
-
environment over HTTP endpoints.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
Usage:
|
| 8 |
# Development:
|
|
@@ -12,7 +20,7 @@ Usage:
|
|
| 12 |
uvicorn server.app:app --host 0.0.0.0 --port 7860
|
| 13 |
|
| 14 |
# Or run directly:
|
| 15 |
-
|
| 16 |
"""
|
| 17 |
|
| 18 |
import sys
|
|
@@ -30,7 +38,7 @@ def main():
|
|
| 30 |
|
| 31 |
This function enables running the server without Docker:
|
| 32 |
uv run --project . server
|
| 33 |
-
python -m
|
| 34 |
"""
|
| 35 |
import uvicorn
|
| 36 |
|
|
|
|
| 2 |
FastAPI application entry point for the DevOps/FinOps OpenEnv Environment.
|
| 3 |
|
| 4 |
This module creates an HTTP server exposing the cloud optimization
|
| 5 |
+
environment over HTTP endpoints, including the interactive playground UI.
|
| 6 |
+
|
| 7 |
+
Endpoints:
|
| 8 |
+
- GET / Interactive playground UI
|
| 9 |
+
- POST /reset Reset the environment
|
| 10 |
+
- POST /step Execute an action
|
| 11 |
+
- GET /state Get current environment state
|
| 12 |
+
- GET /health Health check
|
| 13 |
+
- GET /dashboard Live fleet visualization
|
| 14 |
|
| 15 |
Usage:
|
| 16 |
# Development:
|
|
|
|
| 20 |
uvicorn server.app:app --host 0.0.0.0 --port 7860
|
| 21 |
|
| 22 |
# Or run directly:
|
| 23 |
+
python -m server.app
|
| 24 |
"""
|
| 25 |
|
| 26 |
import sys
|
|
|
|
| 38 |
|
| 39 |
This function enables running the server without Docker:
|
| 40 |
uv run --project . server
|
| 41 |
+
python -m server.app
|
| 42 |
"""
|
| 43 |
import uvicorn
|
| 44 |
|