input: Write a function to create a basic REST API using Python and Flask that lists all the countries in the world when a GET request is made to the '/countries' endpoint. The countries data should be loaded from a 'data.json' file.
  
  
  import flask
  from flask import Flask, request, 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 get_countries().status_code == 200
  assert len(get_countries().json) > 0
  assert get_countries().json[0]['name'] == 'Afghanistan'
  assert get_countries().json[1]['name'] == 'Åland Islands'
  assert get_countries().json[2]['name'] == 'Albania'
output: def get_countries():
      with open('data.json', 'r') as f:
          countries = json.load(f)
      return jsonify(countries)