Loading server.py +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ def get_script(): return send_from_directory('web/js', 'main.js', mimetype=doctype) # Return the prediction label to the frontend @app.route('/predict', methods=["GET"]) @app.route('/predict', methods=["POST"]) def predict(): json = request.get_json() print(json) Loading web/js/main.js +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ function getPrediction() { var http = new XMLHttpRequest(); http.open("GET", url + endpoint, true); http.open("POST", url + endpoint, true); http.onreadystatechange = function () { var DONE = 4; // 4 means that the request is done Loading @@ -28,7 +28,7 @@ function getPrediction() { } } http.send(); http.send(data); } // todo fix this to actually send the message data Loading Loading
server.py +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ def get_script(): return send_from_directory('web/js', 'main.js', mimetype=doctype) # Return the prediction label to the frontend @app.route('/predict', methods=["GET"]) @app.route('/predict', methods=["POST"]) def predict(): json = request.get_json() print(json) Loading
web/js/main.js +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,7 @@ function getPrediction() { var http = new XMLHttpRequest(); http.open("GET", url + endpoint, true); http.open("POST", url + endpoint, true); http.onreadystatechange = function () { var DONE = 4; // 4 means that the request is done Loading @@ -28,7 +28,7 @@ function getPrediction() { } } http.send(); http.send(data); } // todo fix this to actually send the message data Loading