input: Write a function to create a Flask API that takes a list or array of integers and returns their minimum and maximum values. The function should be named `minmax` and should be accessible via a POST request at the '/minmax' route. If the input array is empty, it should return `None` for both the minimum and maximum values.
  
  from flask import Flask, request
  app = Flask(__name__)
  
  @app.route('/minmax', methods=['POST'])
  def minmax():
      data = request.get_json()
      nums = data['nums']
      if not nums:
          return {'min': None, 'max': None}
      minVal = min(nums)
      maxVal = max(nums)
      return {'min': minVal, 'max': maxVal}
  
  if __name__ == '__main__':
      app.run()
  
  assert minmax([12, 4, 9, 24, -5])=={'min': -5, 'max': 24}
  assert minmax([3, 5, 10, 1, 2])=={'min': 1, 'max': 10}
  assert minmax([4, 3, 1, 2])=={'min': 1, 'max': 4}
  assert minmax([])=={'min': None, 'max': None}
output: 
  def minmax():
      data = request.get_json()
      nums = data['nums']
      if not nums:
          return {'min': None, 'max': None}
      minVal = min(nums)
      maxVal = max(nums)
      return {'min': minVal, 'max': maxVal}
  