souljoy commited on
Commit
0d85504
1 Parent(s): 79bb601

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -1,9 +1,12 @@
1
  from flask import Flask, request
2
- # ...
3
 
4
  @app.route('/json_example', methods=['POST'])
5
  def handle_json():
6
  data = request.json
7
  print(data.get('name'))
8
  print(data.get('age'))
9
- return data
 
 
 
 
1
  from flask import Flask, request
2
+ app = Flask(__name__)
3
 
4
  @app.route('/json_example', methods=['POST'])
5
  def handle_json():
6
  data = request.json
7
  print(data.get('name'))
8
  print(data.get('age'))
9
+ return data
10
+
11
+ if __name__ == '__main__':
12
+ app.run()