Skip to content

Commit

Permalink
#3 Create endpoint for returning a random integer
Browse files Browse the repository at this point in the history
  • Loading branch information
LeNPaul committed Apr 11, 2020
1 parent f400c8c commit f1fab6d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
from flask import render_template
app = Flask(__name__)

from random import randint

@app.route('/')
@app.route('/<name>')
def hello(name=None):
value = 100 * 1234
return render_template('index.html', name=value)
def index():
return render_template('index.html')

@app.route('/random')
def calculate():
return str(randint(0,20))

0 comments on commit f1fab6d

Please sign in to comment.