monra commited on
Commit
3c99104
2 Parent(s): d0af07e b726271

Merge pull request #61 from ramonvc/revert-33-main

Browse files

Revert "using WSGI as server inference". Fix: HTTP/2 and async functionality

Files changed (2) hide show
  1. requirements.txt +0 -1
  2. 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
- from gevent import pywsgi
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
- hostname = socket.gethostname()
33
- ip_address = socket.gethostbyname(hostname)
34
-
35
- # Run the Flask server by WSGI
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']}")