修改
This commit is contained in:
@@ -123,14 +123,16 @@ app.mount(
|
||||
# name="static",
|
||||
# )
|
||||
|
||||
# フロントエンドファイル配信(コメントアウト - file://プロトコルで直接アクセスするため不要)
|
||||
# frontend_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "frontend")
|
||||
# if os.path.exists(frontend_path):
|
||||
# app.mount(
|
||||
# "/",
|
||||
# StaticFiles(directory=frontend_path, html=True),
|
||||
# name="frontend",
|
||||
# )
|
||||
# フロントエンドファイル配信
|
||||
frontend_path = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), "frontend")
|
||||
if os.path.exists(frontend_path):
|
||||
app.mount(
|
||||
"/frontend",
|
||||
StaticFiles(directory=frontend_path, html=True),
|
||||
name="frontend",
|
||||
)
|
||||
else:
|
||||
print(f"Frontend path not found: {frontend_path}")
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user