input: Write a function to implement a web server using the Flask framework in Python that serves a JSON object containing the current temperature for a city based on the city name provided in the request. The server should be accessible at the '/getTemp' route, which accepts POST requests. If the city name is valid, the function should return the temperature from an external API. If the city name is not valid, the function should return an appropriate error message.
  assert get_temp_server('New York')=={'temperature': 290.32}
  assert get_temp_server('London')=={'temperature': 289.82}
  assert get_temp_server('InvalidCity')=={'error': 'City not found'}
  assert get_temp_server('')=={'error': 'Invalid city name'}
output: from flask import Flask, request, jsonify
  import requests
  
  app = Flask(__name__)
  
  @app.route('/getTemp', methods=['POST'])
  def get_temp_server():
      city = request.json.get('city')
      if not city:
          return jsonify({'error': 'Invalid city name'})
      
      api_key = 'your_api_key_here'
      url = f'http://api.openweathermap.org/data/2.5/weather?q={city}&appid={api_key}'
      
      response = requests.get(url)
      data = response.json()
      
      if response.status_code == 200:
          temperature = data['main']['temp']
          return jsonify({'temperature': temperature})
      else:
          return jsonify({'error': 'City not found'})