Browse Source

Chapter 2: Dynamic routes (2b)

master
T. Meissner 6 years ago
parent
commit
d44cd7029c
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      hello.py

+ 6
- 0
hello.py View File

@ -1,6 +1,12 @@
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return '<h1>Hello World!</h1>'
@app.route('/user/<name>')
def user(name):
return '<h1>Hello, {}!</h1>'.format(name)

Loading…
Cancel
Save