Frontend
This commit is contained in:
+7
-13
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user