Created
August 24, 2011 11:38
-
-
Save zoranzaric/1167885 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env python | |
import eventlet | |
from eventlet import wsgi | |
def hello_world(env, start_response): | |
start_response('200 OK', [('Content-Type', 'text/plain')]) | |
if env['PATH_INFO'] != '/': | |
if env['PATH_INFO'] == '/status': | |
return ['OK'] | |
else: | |
with open(env['PATH_INFO'][1:], 'w') as file: | |
file.write("") | |
return ['Hello, World! Path was: %s\r\n' % env['PATH_INFO']] | |
wsgi.server(eventlet.listen(('', 8090)), hello_world) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment