input: Write a function to create a basic REST API using Python and Flask to list all the countries in the world. The function should set up a Flask application with a route '/countries' that returns a JSON response containing a list of countries read from a file named 'data.json'. Ensure the application runs when the script is executed directly.
  
  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 'name' in get_countries().json[0] == True
  assert 'region' in get_countries().json[0] == True
  assert len(get_countries().json) > 100 == True
  assert get_countries().status_code == 200
  assert get_countries().content_type == 'application/json'
output: 
  def get_countries():
      with open('data.json', 'r') as f:
          countries = json.load(f)
      return jsonify(countries)
  