Skip to content

Commit

Permalink
doc: update flask.md (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhu0629 committed Apr 21, 2023
1 parent c0da539 commit 1ef8a14
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/flask.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,14 @@ def getImg():
```py
from flask import Blueprint, abort, jsonify

# 定义Bp2,并定义url前缀为/vedio
Bp2 = Blueprint('vedioBlue', __name__, template_folder='templates', url_prefix='/vedio')
# 定义Bp2,并定义url前缀为/video
Bp2 = Blueprint('videoBlue', __name__, template_folder='templates', url_prefix='/video')


@Bp2.route('/getvedio')
def getVedio():
@Bp2.route('/getvideo')
def getvideo():
try:
return jsonify(name="vedio", size="100GB")
return jsonify(name="video", size="100GB")
except Exception as e:
abort(e)
```
Expand All @@ -223,7 +223,7 @@ def getVedio():
```py
from flask import Flask, jsonify
from lantu.img import Bp1
from lantu.vedio import Bp2
from lantu.video import Bp2

app = Flask(__name__)

Expand All @@ -250,6 +250,6 @@ curl http://127.0.0.1:5000/
curl http://127.0.0.1:5000/img/getimg
>> {"name": "img", "size": "100KB"}

curl http://127.0.0.1:5000/vedio/getvedio
>> {"name": "vedio", "size": "100GB"}
curl http://127.0.0.1:5000/video/getvideo
>> {"name": "video", "size": "100GB"}
```

0 comments on commit 1ef8a14

Please sign in to comment.