Spaces:
Sleeping
Sleeping
Afifa Kureshi commited on
Commit ·
d02e2f9
1
Parent(s): 0264810
Fix Space startup health endpoint
Browse files- pyproject.toml +1 -1
- server/app.py +9 -3
pyproject.toml
CHANGED
|
@@ -17,4 +17,4 @@ dependencies = [
|
|
| 17 |
]
|
| 18 |
|
| 19 |
[project.scripts]
|
| 20 |
-
server = "server.app:
|
|
|
|
| 17 |
]
|
| 18 |
|
| 19 |
[project.scripts]
|
| 20 |
+
server = "server.app:main"
|
server/app.py
CHANGED
|
@@ -15,7 +15,13 @@ def reset_env():
|
|
| 15 |
state = env.reset()
|
| 16 |
return {"status": "ok", "state": state}
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
import uvicorn
|
| 21 |
-
uvicorn.run("server.app:app", host="0.0.0.0", port=7860)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
state = env.reset()
|
| 16 |
return {"status": "ok", "state": state}
|
| 17 |
|
| 18 |
+
# --- Bottom of server/app.py ---
|
| 19 |
+
|
| 20 |
+
# Rename 'run' to 'main'
|
| 21 |
+
def main():
|
| 22 |
import uvicorn
|
| 23 |
+
uvicorn.run("server.app:app", host="0.0.0.0", port=7860)
|
| 24 |
+
|
| 25 |
+
# Add the standard Python callable block
|
| 26 |
+
if __name__ == "__main__":
|
| 27 |
+
main()
|