Skip to content

Commit 948c3cc

Browse files
authored
Merge pull request microsoft#4 from Microsoft/kraigb-formatfix
Refactoring changes per Brett
2 parents 042a160 + b589b43 commit 948c3cc

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"request": "launch",
6565
"module": "flask",
6666
"env": {
67-
"FLASK_APP": "hello_app/app.py"
67+
"FLASK_APP": "hello_app.webapp"
6868
},
6969
"args": [
7070
"run",

hello_app/app.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

hello_app/views.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
from datetime import datetime
22
from flask import Flask, render_template
3-
from hello_app import app
3+
from . import app
44

5-
@app.route('/')
5+
@app.route("/")
66
def home():
77
return render_template("home.html")
88

9-
@app.route('/about')
9+
@app.route("/about")
1010
def about():
1111
return render_template("about.html")
1212

13-
@app.route('/contact')
13+
@app.route("/contact")
1414
def contact():
1515
return render_template("contact.html")
1616

17-
@app.route('/hello/')
17+
@app.route("/hello/")
1818
def hello_there(name):
1919
return render_template(
2020
"hello_there.html",
2121
name=name,
2222
date=datetime.now()
2323
)
2424

25-
@app.route('/api/data')
25+
@app.route("/api/data")
2626
def get_data():
2727
return app.send_static_file('data.json')

hello_app/webapp.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""Entry point for the application."""
2+
from . import app # For application discovery by the 'flask' command.
3+
from . import views # For import side-effects of setting up routes.
4+
5+
# Time-saver: output a URL to the VS Code terminal so you can easily Ctrl+click to open a browser
6+
# print('http://127.0.0.1:5000/hello/VSCode')

0 commit comments

Comments
 (0)