Last active
September 3, 2018 02:59
-
-
Save nottrobin/8c12c9921aeb885dbe07 to your computer and use it in GitHub Desktop.
Simple WSGI application server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wsgiref.simple_server import make_server | |
def application(env, start_response): | |
""" | |
A basic WSGI application | |
""" | |
http_status = '200 OK' | |
response_headers = [('Content-Type', 'text/html')] | |
response_text = "Hello World" | |
start_response(http_status, response_headers) | |
return [response_text] | |
if __name__ == "__main__": | |
make_server('', 8000, application).serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment