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 define the Flask app, a route '/countries' that handles GET requests to fetch and return a list of countries from a JSON file, and run the app if the script is executed directly.
  assert get_countries()
  
  ### Expected Output for '/countries' GET Request:
  [
      {"name": "Afghanistan", "code": "AF"},
      {"name": "Albania", "code": "AL"},
      {"name": "Algeria", "code": "DZ"},
      ...
  ]
output: 
  def get_countries():
      from flask import Flask, jsonify
      import json
  
      app = Flask(__name__)
  
      @app.route('/countries', methods=['GET'])
      def countries():
          with open('countries.json', 'r') as file:
              countries_list = json.load(file)
          return jsonify(countries_list)
  
      if __name__ == '__main__':
          app.run(debug=True)
  