flask_inference_api3 / api_logic.py
DmitrMakeev's picture
Create api_logic.py
89fe525 verified
raw
history blame
No virus
541 Bytes
from flask import request, jsonify
def api():
# Читаем значение параметра "ph" из GET-запроса
ph = request.args.get('ph')
# Читаем значение параметра "ec" из GET-запроса
ec = request.args.get('ec')
# Создаем JSON-объект с прочитанными значениями параметров
response = {
"ph_out": ph,
"ec_out": ec
}
# Возвращаем JSON-объект
return jsonify(response)