mirror of
https://github.com/Radiquum/YAMPD.git
synced 2025-05-20 23:59:35 +05:00
fix: dev script
This commit is contained in:
parent
90d8422b81
commit
5ec79945df
2 changed files with 13 additions and 8 deletions
12
src/main.py
12
src/main.py
|
@ -6,11 +6,13 @@ import os
|
|||
app = Flask(__name__)
|
||||
|
||||
|
||||
# TODO: auto copy next html files to templates folder
|
||||
@app.route("/")
|
||||
def index():
|
||||
return render_template("index.html")
|
||||
|
||||
|
||||
# TODO: auto copy next static out on build to static folder
|
||||
@app.route("/<path:path>")
|
||||
def rewrite_next(path):
|
||||
if os.path.exists(f"./static/{path}"):
|
||||
|
@ -24,7 +26,9 @@ def page_not_found(e):
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# If you are debugging you can do that in the browser:
|
||||
app.run(host="0.0.0.0", debug=True, use_reloader=True)
|
||||
# If you want to view the flaskwebgui window:
|
||||
# FlaskUI(app=app, server="flask").run()
|
||||
|
||||
# TODO: if env == dev then Flask if prod then FlaskUI
|
||||
if os.getenv("is_dev") == "True":
|
||||
app.run(host="0.0.0.0", debug=True, use_reloader=True)
|
||||
else:
|
||||
FlaskUI(app=app, server="flask").run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue