input: Write a python function to simulate a basic message board with Flask that supports adding, retrieving, updating, and deleting messages.
  assert all_messages('POST', {'id': 1, 'content': 'Hello World'}) == {1: {'id': 1, 'content': 'Hello World'}}
  assert all_messages('GET') == {1: {'id': 1, 'content': 'Hello World'}}
  assert single_message(1, 'GET') == {'id': 1, 'content': 'Hello World'}
  assert single_message(1, 'PUT', {'id': 1, 'content': 'Updated Message'}) == {'id': 1, 'content': 'Updated Message'}
  assert single_message(1, 'GET') == {'id': 1, 'content': 'Updated Message'}
  assert single_message(1, 'DELETE') == {'message': 'Message deleted'}
  assert all_messages('GET') == {}
output: from flask import Flask, request, jsonify
  
  app = Flask(__name__)
  messages = {}
  
  @app.route('/messages', methods=['POST', 'GET'])
  def all_messages():
      if request.method == 'POST':
          message = request.json
          messages[message['id']] = message
          return jsonify(messages)
      elif request.method == 'GET':
          return jsonify(messages)
  
  @app.route('/messages/<int:message_id>', methods=['GET', 'PUT', 'DELETE'])
  def single_message(message_id):
      if request.method == 'GET':
          message = messages.get(message_id, {})
          return jsonify(message)
      elif request.method == 'PUT':
          updated_message = request.json
          messages[message_id] = updated_message
          return jsonify(updated_message)
      elif request.method == 'DELETE':
          messages.pop(message_id, None)
          return jsonify({'message': 'Message deleted'})
  
  if __name__ == '__main__':
      app.run(debug=True)