lit / app.py
windmaple's picture
Update app.py
fc36b22
raw
history blame
693 Bytes
import os
import json
import requests
import subprocess
from http.server import SimpleHTTPRequestHandler, ThreadingHTTPServer
#subprocess.Popen(["gunicorn", "myapp:get_response", "--bind=0.0.0.0:7860"])
#subprocess.Popen(["gunicorn", "myapp:get_wsgi_app", "--bind=0.0.0.0:7860"])
subprocess.run("GUNICORN_CMD_ARGS='--timeout=500 --bind=0.0.0.0:7860' gunicorn 'quickstart_sst_demo:get_wsgi_app()'", shell=True)
class RequestHandler(SimpleHTTPRequestHandler):
def do_GET(self):
if self.path == "/":
self.path = "index.html"
return SimpleHTTPRequestHandler.do_GET(self)
server = ThreadingHTTPServer(("", 8080), RequestHandler)
server.serve_forever()