input: Write a function to design a web server in Python using the Flask framework that serves a JSON object containing the current temperature for a city based on the city name given in the request. The server should listen for POST requests at the '/getTemp' endpoint, where the request body contains the city name in JSON format. If the weather API query is successful, the server should return the temperature in degrees Kelvin.
  assert get_temp('London', 'http://api.openweathermap.org/data/2.5/weather?q={}&APPID=xxxxxx')=={'temperature': 280.15}
  assert get_temp('New York', 'http://api.openweathermap.org/data/2.5/weather?q={}&APPID=xxxxxx')=={'temperature': 288.15}
  assert get_temp('Sydney', 'http://api.openweathermap.org/data/2.5/weather?q={}&APPID=xxxxxx')=={'temperature': 295.15}
output: 
  import requests
  from flask import Flask, request, jsonify
  
  app = Flask(__name__)
  
  @app.route('/getTemp', methods=['POST'])
  def get_temp():
      city = request.json.get('city')
      api_url = 'http://api.openweathermap.org/data/2.5/weather?q={}&APPID=xxxxxx'
      response = requests.get(api_url.format(city))
      if response.status_code == 200:
          temperature = response.json().get('main', {}).get('temp')
          return jsonify({'temperature': temperature})
      return jsonify({'error': 'Failed to retrieve temperature'}), 500
  