parent
5b309831ec
commit
025589ee76
63 changed files with 3784 additions and 3459 deletions
|
|
@ -3,14 +3,14 @@ from flask import jsonify, render_template, request
|
|||
from js_example import app
|
||||
|
||||
|
||||
@app.route('/', defaults={'js': 'plain'})
|
||||
@app.route('/<any(plain, jquery, fetch):js>')
|
||||
@app.route("/", defaults={"js": "plain"})
|
||||
@app.route("/<any(plain, jquery, fetch):js>")
|
||||
def index(js):
|
||||
return render_template('{0}.html'.format(js), js=js)
|
||||
return render_template("{0}.html".format(js), js=js)
|
||||
|
||||
|
||||
@app.route('/add', methods=['POST'])
|
||||
@app.route("/add", methods=["POST"])
|
||||
def add():
|
||||
a = request.form.get('a', 0, type=float)
|
||||
b = request.form.get('b', 0, type=float)
|
||||
a = request.form.get("a", 0, type=float)
|
||||
b = request.form.get("b", 0, type=float)
|
||||
return jsonify(result=a + b)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue