-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
81 lines (63 loc) · 1.81 KB
/
app.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
from flask import Flask, request, render_template
import sys
import os
import schemes_model as schemes_model
import flask.json as json
from flask_cors import CORS, cross_origin
app = Flask(__name__)
cors = CORS(app)
app.config['CORS_HEADERS'] = 'Content-Type'
@cross_origin()
@app.route('/')
def root():
return render_template('index.html')
@app.route('/index.html')
def index():
return render_template('index.html')
@app.route('/schemesbank.html')
def schemesbank():
return render_template('schemesbank.html')
@app.route('/schemespal.html')
def schemespal():
return render_template('schemespal.html')
@app.route('/schemescase.html')
def schemescase():
return render_template('schemescase.html')
@app.route('/listing.html')
def listing():
return render_template('listing.html')
@app.route('/team.html')
def team():
return render_template('team.html')
@app.route('/update.html')
def update():
return render_template('update.html')
@app.route('/gotit.html')
def gotit():
return render_template('gotit.html')
@app.route('/about.html')
def about():
return render_template('about.html')
@app.route('/blog.html')
def blog():
return render_template('blog.html')
@app.route('/blog/gapfinder-analysis-of-queries-and-listings.html')
def gapfinder():
return render_template('gapfinder-analysis-of-queries-and-listings.html')
@app.route('/testing.html')
def test():
return render_template('testing.html')
@app.route('/schemespredict', methods=['get','post'])
def schemes_predict():
result = 'nil'
try:
input = request.get_json()
query = input['query']
relevance = int(input['relevance'])
result = schemes_model.search_similar_schemes(query, relevance)
except Exception as e:
print('Error: ',e)
return result
if __name__ == '__main__':
port = int(os.getenv("PORT",9099))
app.run(host='0.0.0.0',port=port,debug=True)