|
import flask |
|
from flask import request, jsonify, send_file |
|
import os |
|
|
|
|
|
|
|
from dotenv import load_dotenv |
|
import globs |
|
from flask import render_template |
|
|
|
|
|
from api_logic import api |
|
|
|
|
|
|
|
from google_db import save_db |
|
|
|
from my_sqlite import create_SQL |
|
|
|
load_dotenv() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app = flask.Flask(__name__, template_folder="./") |
|
app.config['DEBUG'] = True |
|
|
|
|
|
|
|
|
|
|
|
@app.route("/") |
|
def index(): |
|
return flask.render_template('index.html') |
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/online', methods=['GET']) |
|
def online(): |
|
return render_template('online.html') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/settings', methods=['GET']) |
|
def settings(): |
|
return render_template('settings.html') |
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route("/api", methods=['GET']) |
|
def handle_api(): |
|
response = api() |
|
return response |
|
|
|
|
|
@app.route("/save_db", methods=['GET']) |
|
def handle_save_db(): |
|
response = save_db() |
|
return response |
|
|
|
|
|
@app.route('/set_res') |
|
def set_res(): |
|
globs.eep_set = 0 |
|
return jsonify(value_set="reset") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
app.run(host='0.0.0.0', port=int(os.environ.get('PORT', 7860))) |