Skip to content

Commit 4f9f2f9

Browse files
committed
Created an application instance to return HTML
0 parents  commit 4f9f2f9

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

python.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Remember to pip install flask
2+
from flask import render_template
3+
import connexion
4+
5+
# Create an application instance (__name__ & template_folder are built in with Flask)
6+
app = connexion.App(__name__, specification_dir='./')
7+
8+
# Read the swagger.yml file to configure the endpoints
9+
app.add_api('swagger.yml')
10+
11+
# Create a URL route for "/" in our application
12+
@app.route("/")
13+
def home():
14+
return render_template('home.html')
15+
16+
# This part I don't get
17+
if __name__ == '__main__':
18+
app.run(debug=True)
19+

0 commit comments

Comments
 (0)