Skip to content

Instantly share code, notes, and snippets.

Created March 5, 2021 07:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
from wsgiref.simple_server import make_server, WSGIServer
from socketserver import ThreadingMixIn
import time
def hello_world_app(environ, start_response):
start_response('200 OK', [])
path_info = environ['PATH_INFO']
yield f"Hello World{path_info}\n".encode("utf8")
class ThreadedWSGIServer(ThreadingMixIn, WSGIServer):
http = make_server('', 8000, hello_world_app, server_class=ThreadedWSGIServer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment