Spaces:
Running
Running
Revert "using WSGI as server inference"
Browse files- requirements.txt +0 -1
- run.py +5 -13
requirements.txt
CHANGED
@@ -24,4 +24,3 @@ tornado>=6.3.2 # pinned to avoid a vulnerability
|
|
24 |
PyExecJS
|
25 |
browser_cookie3
|
26 |
googletrans==4.0.0rc1
|
27 |
-
gevent
|
|
|
24 |
PyExecJS
|
25 |
browser_cookie3
|
26 |
googletrans==4.0.0rc1
|
|
run.py
CHANGED
@@ -2,8 +2,7 @@ from server.app import app
|
|
2 |
from server.website import Website
|
3 |
from server.backend import Backend_Api
|
4 |
from json import load
|
5 |
-
|
6 |
-
import socket
|
7 |
|
8 |
if __name__ == '__main__':
|
9 |
|
@@ -29,14 +28,7 @@ if __name__ == '__main__':
|
|
29 |
methods=backend_api.routes[route]['methods'],
|
30 |
)
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
print(f"Running on http://127.0.0.1:{site_config['port']}")
|
37 |
-
print(f"Running on http://{ip_address}:{site_config['port']}")
|
38 |
-
|
39 |
-
server = pywsgi.WSGIServer(('0.0.0.0', site_config['port']), app)
|
40 |
-
server.serve_forever()
|
41 |
-
|
42 |
-
print(f"Closing {ip_address}:{site_config['port']}")
|
|
|
2 |
from server.website import Website
|
3 |
from server.backend import Backend_Api
|
4 |
from json import load
|
5 |
+
|
|
|
6 |
|
7 |
if __name__ == '__main__':
|
8 |
|
|
|
28 |
methods=backend_api.routes[route]['methods'],
|
29 |
)
|
30 |
|
31 |
+
# Run the Flask server
|
32 |
+
print(f"Running on port {site_config['port']}")
|
33 |
+
app.run(**site_config)
|
34 |
+
print(f"Closing port {site_config['port']}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|