-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
50 lines (30 loc) · 1.02 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
from flask import Flask, render_template, jsonify, request
import process
app = Flask(__name__)
app.static_folder = 'static'
@app.route("/")
def home():
return render_template("index.html")
@app.route("/bot")
def chatbot():
return render_template("chatbot.html")
@app.route("/get")
def get_bot_response():
userText = str(request.args.get('msg'))
return process.generate_response(userText)
if __name__ == "__main__":
app.run()
# @app.route('/', methods=["GET", "POST"])
# def index():
# return render_template('index.html', **locals())
# @app.route('/bot', methods=["GET", "POST"])
# def bot():
# return render_template('chatbot.html', **locals())
# @app.route('/chatbot', methods=["GET", "POST"])
# def chatbotResponse():
# if request.method == 'POST':
# the_question = request.form['question']
# response = processor.chatbot_response(the_question)
# return jsonify({"response": response })
# if __name__ == '__main__':
# app.run(host='0.0.0.0', port='8888', debug=True)