jqueryexample.py
This file
Path
examples/jqueryexample/jqueryexample.py
28 lines · 658 bytes · Python
Last changed by
resolve merge conflictsKenneth Reitzbefore adoption31174fe
History of this fileTake it
The walk stopped after 200 commits: lines older than 1eede1d point at it.
Merge pull request #1064 from kekumu/patch-adv-forewordKenneth Reitzbefore adoption1eede1d
lines 1–7why, one step back1# -*- coding: utf-8 -*-2"""3 jQuery Example4 ~~~~~~~~~~~~~~56 A simple application that shows how Flask and jQuery get along.7Merge pull request #1303 from Parkayun/masterMarkus Unterwaditzerbefore adoption5b98266
line 8why, one step back8 :copyright: (c) 2015 by Armin Ronacher.Merge pull request #1064 from kekumu/patch-adv-forewordKenneth Reitzbefore adoption1eede1d
lines 9–25why, one step back9 :license: BSD, see LICENSE for more details.10"""11from flask import Flask, jsonify, render_template, request12app = Flask(__name__)131415@app.route('/_add_numbers')16def add_numbers():17 """Add two numbers server side, ridiculous but well..."""18 a = request.args.get('a', 0, type=int)19 b = request.args.get('b', 0, type=int)20 return jsonify(result=a + b)212223@app.route('/')24def index():25 return render_template('index.html')resolve merge conflictsKenneth Reitzbefore adoption31174fe
lines 26–28why, one step back2627if __name__ == '__main__':28 app.run()