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