From 3ef05c6e77c3c5aa48721b667f3d0219eba8f3dc Mon Sep 17 00:00:00 2001 From: Mario Krajacic Date: Wed, 22 Jul 2020 19:08:15 +0200 Subject: [PATCH] Added index.html and calling API from JS --- app.py | 7 ++++++- templates/index.html | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 templates/index.html diff --git a/app.py b/app.py index 3328e0f..02802ea 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,4 @@ -from flask import Flask, jsonify, request +from flask import Flask, jsonify, request, render_template app = Flask(__name__) @@ -15,6 +15,11 @@ ] +@app.route('/') +def home(): + return render_template('index.html') + + # POST /store data: {name:} @app.route('/store', methods=['POST']) def create_store(): diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..f9040da --- /dev/null +++ b/templates/index.html @@ -0,0 +1,25 @@ + + + + + +
+ Hello, world! +
+ + + + \ No newline at end of file