sanic版本

# 版本,Blueprint('/',version=1)
# http://127.0.0.1:8000/v1
# 在蓝图中也可添加
from sanic import Sanic
from sanic.response import json
app=Sanic("app")


@app.post('/',version=1)
async def test(request):
    name=request.form.get("name")
    return json({'name':name})


if __name__ == '__main__':
    app.run(host="0.0.0.0",port=8000,debug=True)

 

posted on 2021-06-16 11:13  HHMLXL  阅读(85)  评论(0)    收藏  举报

导航