基于python3.5 的web服务器Sanic.zip

时间:2022-08-08 01:10:20
【文件属性】:
文件名称:基于python3.5 的web服务器Sanic.zip
文件大小:250KB
文件格式:NONE
更新时间:2022-08-08 01:10:20
开源项目 Sanic 是一个基于 Python 3.5 的 Web 服务器,与 Flask 有点类似,特点是速度非常快。速度对比所有测试都在运行 ubuntu 的 AWS 介质实例上运行,使用1个进程。 每个脚本都传递了一个小的 JSON 响应,并使用100个连接使用 wrk 进行测试。 Hello World 示例from sanic import Sanic from sanic.response import json app = Sanic() @app.route("/") async def test(request):     return json({"hello": "world"}) if __name__ == "__main__":     app.run(host="0.0.0.0", port=8000) 标签:Sanic

网友评论