mirror of
https://github.com/Radiquum/YAMPD.git
synced 2025-05-20 07:39:35 +05:00
fix: build for multi page frontend
This commit is contained in:
parent
af7b8a6fea
commit
7f704ec75a
3 changed files with 14 additions and 3 deletions
13
build.py
13
build.py
|
@ -49,10 +49,19 @@ if __name__ == "__main__":
|
||||||
shutil.copyfile(f"./gui/out/{file}", f"{OUT_DIR}/static/{file}")
|
shutil.copyfile(f"./gui/out/{file}", f"{OUT_DIR}/static/{file}")
|
||||||
|
|
||||||
for dir in dirs:
|
for dir in dirs:
|
||||||
print(f"Copied directory: './gui/out/{dir}' -> '{OUT_DIR}/static/{dir}'")
|
if dir == "_next":
|
||||||
|
print(f"Copied directory: './gui/out/{dir}' -> '{OUT_DIR}/static/{dir}'")
|
||||||
|
shutil.copytree(
|
||||||
|
f"./gui/out/{dir}", f"{OUT_DIR}/static/{dir}", dirs_exist_ok=True
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
print(f"Copied directory: './gui/out/{dir}' -> '{OUT_DIR}/templates/{dir}'")
|
||||||
shutil.copytree(
|
shutil.copytree(
|
||||||
f"./gui/out/{dir}", f"{OUT_DIR}/static/{dir}", dirs_exist_ok=True
|
f"./gui/out/{dir}", f"{OUT_DIR}/templates/{dir}", dirs_exist_ok=True
|
||||||
)
|
)
|
||||||
|
|
||||||
print(f"Copied app: './src' -> '{OUT_DIR}'")
|
print(f"Copied app: './src' -> '{OUT_DIR}'")
|
||||||
shutil.copytree("./src", f"{OUT_DIR}/", dirs_exist_ok=True)
|
shutil.copytree("./src", f"{OUT_DIR}/", dirs_exist_ok=True)
|
||||||
|
|
||||||
|
if os.path.exists(f"{OUT_DIR}/__pycache__") and os.path.isdir(f"{OUT_DIR}/__pycache__"):
|
||||||
|
shutil.rmtree(f"{OUT_DIR}/__pycache__")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const API = process.env.NEXT_PUBLIC_API_URL;
|
const API = process.env.NEXT_PUBLIC_API_URL || "/api";
|
||||||
|
|
||||||
export const ENDPOINTS = {
|
export const ENDPOINTS = {
|
||||||
createPack: `${API}/pack/new`,
|
createPack: `${API}/pack/new`,
|
||||||
|
|
|
@ -20,6 +20,8 @@ def index():
|
||||||
def rewrite_next(path):
|
def rewrite_next(path):
|
||||||
if os.path.exists(f"./static/{path}"):
|
if os.path.exists(f"./static/{path}"):
|
||||||
return send_file(f"./static/{path}")
|
return send_file(f"./static/{path}")
|
||||||
|
if os.path.exists(f"./templates/{path}.html"):
|
||||||
|
return render_template(f"{path}.html")
|
||||||
return abort(404)
|
return abort(404)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue