lit / app.py
windmaple's picture
Create new file
6f9d3db
raw
history blame
685 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.Popen("gunicorn -c gunicorn_config.py '--bind=0.0.0.0:7860' '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()