input: Write a function to create a REST API using Flask that retrieves and lists all the countries from a JSON file named 'data.json'. The function should define the route '/countries' as a GET endpoint to serve this purpose. If the application is run directly, it should start the Flask server.
  assert get_countries() == jsonify(countries)from data.json
  if __name__ == '__main__':
   app.run()
output: 
  @app.route('/countries', methods=['GET'])
  def get_countries():
      with open('data.json', 'r') as file:
          countries = json.load(file)
      return jsonify(countries)
  