"""WSGI server example"""
from future import print_function
import sys
import webob
from webob import Request, Response
from gevent import monkey
monkey.patch_all()
from gevent.pywsgi import WSGIServer
def application(env, start_response):
a = Request(env)
for k,v in env.items():
print(k, v)
print("=====", a.json, type(a.json))
if env['PATH_INFO'] == '/':
!/usr/bin/python
"""WSGI server example""" from future import print_function
import sys
import webob from webob import Request, Response from gevent import monkey monkey.patch_all() from gevent.pywsgi import WSGIServer
def application(env, start_response): a = Request(env) for k,v in env.items(): print(k, v) print("=====", a.json, type(a.json)) if env['PATH_INFO'] == '/':
start_response('200 OK', [('Content-Type', 'application/json')])
if name == 'main': print(sys.version) print('Serving on 8088...') WSGIServer(('127.0.0.1', 8088), application).serve_forever()