Spaces:
Sleeping
Sleeping
File size: 1,049 Bytes
f18f04b 3b33a44 e9edc80 5e5ef88 edba818 c7511da 29f39e5 5351cfc 95934cc e9edc80 ec447d0 e9edc80 3ab3bfe ec447d0 30cb684 7a42f0c 70f7ff7 ec447d0 2ab4f80 ec447d0 ff14c27 ec447d0 89cecb3 ff14c27 89cecb3 f8101df 2ab4f80 c7511da 1a7f16a c7511da f18f04b 0cf3e5e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
import flask
from flask import request, jsonify
import os
from dotenv import load_dotenv
import globs
from flask import render_template
from api_logic import api
load_dotenv()
app = flask.Flask(__name__, template_folder="./")
app.config['DEBUG'] = True
@app.route("/")
def index():
return flask.render_template('index.html')
@app.route('/page', methods=['GET'])
def page():
return render_template('zapro.html')
@app.route('/zapro', methods=['GET'])
def zapro():
# globs.initialize()
# return flask.render_template('zapro.html', ph_values=globs.ph_value, ec_values=globs.ec_value)
return jsonify(dey=globs.dey, wek=globs.wek, ph=globs.ph, ec=globs.ec, tS=globs.tS, tA=globs.tA, hDm=globs.hDm, sVen=globs.sVen)
# return render_template('zapro.html', ph_values=globs.ph_value, ec_values=globs.ec_value)
@app.route("/api", methods=['GET'])
def handle_api():
response = api()
return response
if __name__ == '__main__':
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860))) |