Commit 65b2cd87 authored by Mohamed Naseef's avatar Mohamed Naseef

Upload New File

parent d3129896
from flask import Flask, request
import json
from chat import chat_bot
from decisiontree import calculate
from landanalysis import land_analysis
app = Flask(__name__)
@app.route('/chat_bot', methods=['POST'])
def process_json():
json = request.json
print("json data: ", json['message'])
return {"output" : chat_bot(json['message'])}
@app.route('/decession_tree', methods=['GET'])
def process_json_decission():
return {"output" : calculate()}
@app.route('/land_analysis', methods=['POST'])
def process_json_land():
json = request.json
lat = json['lat']
long = json['long']
return {"output" : land_analysis(lat, long)}
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment