Skip to content

Instantly share code, notes, and snippets.

@zoranzaric
Created August 24, 2011 11:38
Show Gist options
  • Save zoranzaric/1167885 to your computer and use it in GitHub Desktop.
Save zoranzaric/1167885 to your computer and use it in GitHub Desktop.
#!/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