input: Write a function to create a basic REST API using Python and Flask that lists all the countries in the world. The function should initialize a Flask app, define a route to GET all countries from a JSON file, and run the app.
  
  
  from flask import Flask, jsonify
  import json
  
  app = Flask(__name__)
  
  @app.route('/countries', methods=['GET'])
  def get_countries():
      with open('data.json', 'r') as f:
          countries = json.load(f)
      return jsonify(countries)
  
  if __name__ == '__main__':
      app.run()
  
  
  assert app.route('/countries', methods=['GET'])
  assert app.run()
output: 
  def create_rest_api():
      from flask import Flask, jsonify
      import json
  
      app = Flask(__name__)
  
      @app.route('/countries', methods=['GET'])
      def get_countries():
          with open('data.json', 'r') as f:
              countries = json.load(f)
          return jsonify(countries)
  
      if __name__ == '__main__':
          app.run()
  