Spaces:
Sleeping
Sleeping
Add web manifest route
Browse files- server/app.py +16 -0
server/app.py
CHANGED
|
@@ -3,6 +3,7 @@
|
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
import uvicorn
|
|
|
|
| 6 |
from openenv.core import create_app
|
| 7 |
|
| 8 |
try:
|
|
@@ -28,6 +29,21 @@ app = create_app(
|
|
| 28 |
)
|
| 29 |
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
def run(host: str = "0.0.0.0", port: int = 8000) -> None:
|
| 32 |
"""Run the OpenEnv HTTP server."""
|
| 33 |
uvicorn.run(app, host=host, port=port)
|
|
|
|
| 3 |
from __future__ import annotations
|
| 4 |
|
| 5 |
import uvicorn
|
| 6 |
+
from fastapi.responses import JSONResponse
|
| 7 |
from openenv.core import create_app
|
| 8 |
|
| 9 |
try:
|
|
|
|
| 29 |
)
|
| 30 |
|
| 31 |
|
| 32 |
+
@app.get("/manifest.json", include_in_schema=False)
|
| 33 |
+
def manifest() -> JSONResponse:
|
| 34 |
+
return JSONResponse(
|
| 35 |
+
{
|
| 36 |
+
"name": "Engineer Manager",
|
| 37 |
+
"short_name": "Engineer Manager",
|
| 38 |
+
"start_url": "/web/",
|
| 39 |
+
"display": "standalone",
|
| 40 |
+
"background_color": "#0b1224",
|
| 41 |
+
"theme_color": "#0b1224",
|
| 42 |
+
"icons": [],
|
| 43 |
+
}
|
| 44 |
+
)
|
| 45 |
+
|
| 46 |
+
|
| 47 |
def run(host: str = "0.0.0.0", port: int = 8000) -> None:
|
| 48 |
"""Run the OpenEnv HTTP server."""
|
| 49 |
uvicorn.run(app, host=host, port=port)
|