forked from andreaiacono/python-playground
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflaskapp.py
More file actions
executable file
·32 lines (21 loc) · 742 Bytes
/
flaskapp.py
File metadata and controls
executable file
·32 lines (21 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from flask import Flask, render_template, send_from_directory, request
from sequence_finder import finder
app = Flask(__name__)
app.config.from_pyfile('flaskapp.cfg')
@app.route('/')
def index():
return render_template('index.html')
@app.route('/<path:resource>')
def serveStaticResource(resource):
return send_from_directory('static/', resource)
@app.route("/test")
def test():
return render_template("sequence_finder/math.html")
@app.route("/finder", methods=['GET'])
def sequence_finder():
return render_template("sequence_finder/index.html")
@app.route("/finder_exec", methods=[ 'POST'])
def exec_finder():
return finder.execute(request.form['values'])
if __name__ == '__main__':
app.run(threaded=True)