text: from flask import Flask, request, jsonify, render_template
  from flask_cors import CORS, cross_origin
  
  from core.src.service.DataService import DataService
  
  app = Flask(__name__)
  cors = CORS(app)
  app.config['CORS_HEADERS'] = 'Content-Type'
  
  
  @app.route('/')
  def index():
      return render_template("index.html")
  
  
  @app.route('/process', methods=['POST'])
  @cross_origin()
  def process_dataset():
      data = request.get_json()
  
      DataService.set_is_hyperparam_enabled(data['isHyperparamEnabled'])
      DataService.set_json_data(data)
      DataService.process_data()
  
      return ""
  
  
  @app.route('/trained', methods=['GET'])
  @cross_origin()
  def get_trained_models():
      return jsonify(DataService.get_trained_estimators_results_without_hyperparam_tuning())
  
  
  @app.route('/hyper_trained', methods=['GET'])
  @cross_origin()
  def get_hyper_trained_models():
      return jsonify(DataService.get_trained_estimators_results_with_hyperparam_tuning())
  
  
  @app.route('/results', methods=['GET'])
  @cross_origin()
  def get_profiler_results():
      response = DataService.get_results()
      return jsonify(response)
  
  
  @app.route('/upload', methods=['POST'])
  @cross_origin()
  def upload_dataset():
      DataService.reset_variables()
      DataService.set_dataset(request.files.get('dataset'))
      return jsonify(DataService.get_dataset_columns())
  
  
  @app.route('/target', methods=['POST'])
  @cross_origin()
  def set_target_column():
      DataService.set_target_column_name(request.form['targetCol'])
      DataService.split_dataset()
  
      return ""
  
  
  @app.route("/algorithms", methods=['POST'])
  @cross_origin()
  def set_algorithms():
      incoming_json = request.get_json()
      DataService.set_minimum_acceptable_rank(incoming_json['minimumAcceptableRank'])
      DataService.run_profiling(incoming_json['selectedIndexes'])
      return ""
  
  # if __name__ == '__main__':
  #    app.run(debug=True)
  