def index(date=None): if date is None: yesterday = getDate() cases = get_covid_cases(yesterday) else: cases = get_covid_cases(date) return render_template('index.html', cases=cases)
def index(date=None): query_date= request.args.get("date") # queryparams # body_data = request.jsonify # print(body_data) # This is used when you want to pass data to the request. # cases=get_covid_cases(URL) if date is None: yesterday = getdate() cases = get_covid_cases(yesterday) if query_date is not None: d = query_date else: d = getdate() cases = get_covid_cases(d) else: cases = get_covid_cases(date) # if request.args.get("date") is not None: # d = query_date # else: # getdate() # # print("date: " + date) # else: # # print(date) # cases = get_covid_cases(date) return jsonify({'total_cases':cases})
def index(date=None): if date is None: yesterday = getDate() cases = get_covid_cases(yesterday) else: cases = get_covid_cases(date) return jsonify({"total_cases": cases})
def index(date=None): query_date = request.args.get("date") body_data = request.json if date is None: if query_date is not None: d = query_date else: d = getDate() cases = get_covid_cases(d) else: cases = get_covid_cases(date) return jsonify({"total_cases": cases})
def index(date=None): body_data = requests.json print(body_data) if date is None: if query_date is not None: d = query_date else: d = getDate() # yesterday = getDate() cases = get_covid_cases(d) else: cases = get_covid_cases(date) return jsonify({"total_cases": cases})
def index(): # print(res) cases = get_covid_cases(base_url) return jsonify({"total_cases": cases})
def api(): cases = get_covid_cases(URL) return jsonify({"total_cases": cases})