我的WSGI服务器
效果:
代码:
from wsgiref.simple_server import make_server
def run_server(environ,start_response):
start_response("200 OK",[('Content-Type','text/html;charset=utf-8')])
return [bytes("<h1>我的WSGI服务器</h1>",encoding="utf-8"),]
server = make_server('localhost',8000,run_server)
server.serve_forever()