Last active
October 11, 2016 17:47
-
-
Save remkohdev/a5c9fe40c18075544674ca8b2c8a7362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from flask import Flask, jsonify, render_template, Response, request | |
app = Flask(__name__) | |
@app.route('/') | |
def Welcome(): | |
#return app.send_static_file('index.html') | |
return render_template('index.html') | |
@app.route('/search') | |
def Search(startdate=None, enddate=None, searchterm=None, count=None): | |
startdate = request.args.get('startdate', '7daysago') | |
enddate = request.args.get('enddate', 'today') | |
searchterm = request.args.get('searchterm') | |
count = request.args.get('count') | |
response = { | |
'startdate' : startdate, | |
'enddate' : enddate, | |
'searchterm' : searchterm, | |
'count' : count | |
} | |
return render_template('report.html', | |
response=response) | |
port = os.getenv('PORT', '5000') | |
if __name__ == "__main__": | |
app.run(host='0.0.0.0', port=int(port)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment