This commit is contained in:
2020-01-02 14:42:02 -05:00
parent 59e243472b
commit 9f9b911ca0
15 changed files with 433 additions and 15 deletions
+7 -13
View File
@@ -2,12 +2,7 @@ from flask import Flask, render_template, request, jsonify
from .controller import Controller
app = Flask(
__name__,
static_folder="./frontend/dist",
static_url_path="/",
template_folder="./frontend/dist",
)
app = Flask(__name__, static_folder="./client/build", static_url_path="/assets")
controller = Controller()
@@ -46,13 +41,12 @@ def gain():
return jsonify(controller.set_gain(amount))
@app.route("/")
@app.route("/", defaults={"path": ""})
@app.route("/<path:path>")
def index(path: str = ""):
print(f"PATH: {path}")
return render_template("index.html")
def index(path: str):
return render_template("index.html.j2")
@app.errorhandler(404)
def not_found(*args, **kwargs):
return render_template("index.html")
# @app.errorhandler(404)
# def not_found(*args, **kwargs):
# return render_template("index.html.j2")