Simplify health response and disable SSR
Browse files
API.md
CHANGED
|
@@ -8,7 +8,7 @@ Use the Space URL as the base URL. Every endpoint requires `p` to match the lowe
|
|
| 8 |
GET /health?p=PASSWORD
|
| 9 |
```
|
| 10 |
|
| 11 |
-
Returns `{"status":
|
| 12 |
|
| 13 |
## Generate
|
| 14 |
|
|
|
|
| 8 |
GET /health?p=PASSWORD
|
| 9 |
```
|
| 10 |
|
| 11 |
+
Returns `{"status":true}` when the application is ready.
|
| 12 |
|
| 13 |
## Generate
|
| 14 |
|
app.py
CHANGED
|
@@ -351,7 +351,7 @@ def require_pass(p: str = Query(...)):
|
|
| 351 |
|
| 352 |
@api.get("/health", dependencies=[Depends(require_pass)])
|
| 353 |
def health():
|
| 354 |
-
return {"status":
|
| 355 |
|
| 356 |
|
| 357 |
@api.get("/system_stats", dependencies=[Depends(require_pass)])
|
|
@@ -458,6 +458,7 @@ if __name__ == "__main__":
|
|
| 458 |
demo.launch(
|
| 459 |
server_name="0.0.0.0",
|
| 460 |
server_port=PORT,
|
|
|
|
| 461 |
css_paths="style.css",
|
| 462 |
head='<link rel="icon" href="data:;base64,=">',
|
| 463 |
_app=api,
|
|
|
|
| 351 |
|
| 352 |
@api.get("/health", dependencies=[Depends(require_pass)])
|
| 353 |
def health():
|
| 354 |
+
return {"status": True}
|
| 355 |
|
| 356 |
|
| 357 |
@api.get("/system_stats", dependencies=[Depends(require_pass)])
|
|
|
|
| 458 |
demo.launch(
|
| 459 |
server_name="0.0.0.0",
|
| 460 |
server_port=PORT,
|
| 461 |
+
ssr_mode=False,
|
| 462 |
css_paths="style.css",
|
| 463 |
head='<link rel="icon" href="data:;base64,=">',
|
| 464 |
_app=api,
|