hello.py 347 B

123456789101112131415
  1. import simplejson
  2. def app(environ, start_response):
  3. response = {
  4. "message": "Hello, World!"
  5. }
  6. data = simplejson.dumps(response)
  7. status = '200 OK'
  8. response_headers = [
  9. ('Content-type', 'text/plain'),
  10. ('Content-Length', str(len(data)))
  11. ]
  12. start_response(status, response_headers)
  13. return [data]