smart-chatbot / app.py
Adityabhatia0204's picture
Update app.py
06964e3 verified
raw
history blame contribute delete
437 Bytes
from flask import Flask, render_template, request, jsonify
from chat import chatbot
app = Flask(__name__)
@app.route("/")
def home():
return "Smart Chatbot API is running!"
@app.route("/ask", methods=['POST'])
def ask():
message = str(request.form['messageText'])
bot_response = chatbot(message)
return jsonify({'status':'OK','answer': bot_response})
if __name__ == "__main__":
app.run(host="0.0.0.0", port=7860)