diff --git a/sustainml_modules/sustainml_modules/sustainml-wp4/frontend_node.py b/sustainml_modules/sustainml_modules/sustainml-wp4/frontend_node.py index 7376ec9..aa2aea8 100644 --- a/sustainml_modules/sustainml_modules/sustainml-wp4/frontend_node.py +++ b/sustainml_modules/sustainml_modules/sustainml-wp4/frontend_node.py @@ -237,5 +237,24 @@ def send_pd(): except Exception as e: return jsonify({'error': str(e)}), 500 +@app.route('/get_status', methods=['GET']) +def get_status(): + try: + print ("get_status") + # pipe the information to the backend + response = requests.get('http://127.0.0.1:5001/status') + return jsonify(response.json()), 200 + except Exception as e: + return jsonify({'error': str(e)}), 500 + +@app.route('/get_results', methods=['GET']) +def get_results(): + try: + # pipe the information to the backend + response = requests.get('http://127.0.0.1:5001/results') + return jsonify(response.json()), 200 + except Exception as e: + return jsonify({'error': str(e)}), 500 + if __name__ == '__main__': app.run(debug=True) diff --git a/sustainml_modules/sustainml_modules/sustainml-wp4/index.html b/sustainml_modules/sustainml_modules/sustainml-wp4/index.html index d60e97f..7a68ee5 100644 --- a/sustainml_modules/sustainml_modules/sustainml-wp4/index.html +++ b/sustainml_modules/sustainml_modules/sustainml-wp4/index.html @@ -42,6 +42,18 @@