hello.py 331 B

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