Created
January 13, 2012 13:29
-
-
Save longfin/1606137 to your computer and use it in GitHub Desktop.
very simple wsgi application(via class)
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
class App(object): | |
def __init__(self, environ, start_response): | |
self.environ = environ | |
self.start_response = start_response | |
def __iter__(self): | |
status = '200 OK' | |
response_body = "Hello World!" | |
response_headers = [('Content-Type', 'text/plain'), | |
('Content-Length', str(len(response_body)))] | |
self.start_response(status, response_headers) | |
yield response_body |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment