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 POST request. If the city name is not provided or the city is not found, return an error message. The API used to fetch the temperature data is 'http://api.openweathermap.org/data/2.5/weather'.
  
  from flask import Flask, request
  import requests
  import json
  
  app = Flask(__name__)
  
  @app.route('/getTemp', methods=['POST'])
  def get_temp():
      if not request.json or 'city' not in request.json:
          return {'error': 'City name not provided'}, 400
      city = request.json['city']
      url = 'http://api.openweathermap.org/data/2.5/weather?q={}&APPID=xxxxx'
      r = requests.get(url.format(city))
      if r.status_code != 200:
          return {'error': 'City not found'}, 404
      weather = json.loads(r.text)
      return {'temperature': weather['main']['temp']}
  
  if __name__ == '__main__':
      app.run(debug=True)
  
  assert get_temp == {'temperature': 293.15}
output: 
  def get_temp():
      if not request.json or 'city' not in request.json:
          return {'error': 'City name not provided'}, 400
      city = request.json['city']
      url = 'http://api.openweathermap.org/data/2.5/weather?q={}&APPID=xxxxx'
      r = requests.get(url.format(city))
      if r.status_code != 200:
          return {'error': 'City not found'}, 404
      weather = json.loads(r.text)
      return {'temperature': weather['main']['temp']}
  