Skip to content
This repository has been archived by the owner on Jan 11, 2020. It is now read-only.

Commit

Permalink
Merge pull request #65 from CleverFool77/task11
Browse files Browse the repository at this point in the history
task 11 completed
  • Loading branch information
Anupam-dagar committed Feb 6, 2019
2 parents c1ba3cb + c9797fd commit 90f97df
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Task 11/CleverFool77/run.py
@@ -1,5 +1,6 @@
#!flask/bin/python
from flask import Flask,request,jsonify
import random

app = Flask(__name__)

Expand Down Expand Up @@ -35,8 +36,15 @@ def index():
return "Hello, World!"

@app.route('/quote', methods=['GET'])
def get_tasks():
def get_quotes():
return jsonify({'quote': quote})

@app.route('/random', methods=['GET'])
def get_random_quote():
# import pdb; pdb.set_trace()
i = random.randint(0,len(quote)-1)
random_quote = quote[i]
return jsonify({'quote': random_quote })

if __name__ == '__main__':
app.run(debug=True)

0 comments on commit 90f97df

Please sign in to comment.