没有项目描述
http-async-web的Python项目详细描述
http async web是一个python 3.7+异步web服务器和web框架,编写起来很快。它允许使用python 3.5中添加的async/await语法,这使您的代码无阻塞且快速。
Source code on GitHubHelp and discussion board。
该项目由社区维护,为社区服务。^{str 1}欢迎捐款!
该项目的目标是提供一种简单的方法来启动和运行一个高性能的http服务器,该服务器易于构建、扩展和最终扩展。
安装
pip3 install http-async-web
$ exportLONELY=true $ pip3 install --no-binary :all: http-async-web
注意
如果您运行的是fedora 28或更高版本的干净安装,请确保安装了redhat-rpm-config包,以防您希望 将http-async-web与ujson依赖项一起使用。
Hello World示例
fromhttp-async-webimportLovefromhttp-async-web.responseimportjsonapp=http()@app.route('/')asyncdeftest(request):returnjson({'hello':'there'})if__name__=='__main__':app.run(host='0.0.0.0',port=9999)