momyc

Minimal handler

Mar 31st, 2013
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. def handler(request):
  2.     request.stdout.write('\r\n'.join((
  3.         'Status: 200 OK',
  4.         'Content-type: text/plain',
  5.         '',
  6.         'Hello, World!',
  7.         )))
  8.  
  9. if __name__ == '__main__':
  10.     from gevent_fastcgi.server import FastCGIServer
  11.  
  12.     FastCGIServer('/path/to/unix/socket', handler).serve_forever()
Advertisement
Add Comment
Please, Sign In to add comment