Spaces:
Sleeping
Sleeping
Commit ·
5322eaf
1
Parent(s): 4dc3c1d
fix: standardized server entry point with callable main function
Browse files- pyproject.toml +1 -1
- server/app.py +9 -0
pyproject.toml
CHANGED
|
@@ -20,7 +20,7 @@ dependencies = [
|
|
| 20 |
]
|
| 21 |
|
| 22 |
[project.scripts]
|
| 23 |
-
server = "server.app:
|
| 24 |
|
| 25 |
[tool.setuptools]
|
| 26 |
packages = ["backend", "server"]
|
|
|
|
| 20 |
]
|
| 21 |
|
| 22 |
[project.scripts]
|
| 23 |
+
server = "server.app:main"
|
| 24 |
|
| 25 |
[tool.setuptools]
|
| 26 |
packages = ["backend", "server"]
|
server/app.py
CHANGED
|
@@ -1 +1,10 @@
|
|
| 1 |
from backend.app.main import app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from backend.app.main import app
|
| 2 |
+
import uvicorn
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def main():
|
| 6 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
if __name__ == "__main__":
|
| 10 |
+
main()
|