Update app.py
Browse files
app.py
CHANGED
|
@@ -28,10 +28,10 @@ def clone_and_setup_repo():
|
|
| 28 |
os.system("npm start")
|
| 29 |
|
| 30 |
# index.htmlをカレントディレクトリに移動
|
| 31 |
-
index_html_path = os.path.join(temp_dir, '
|
| 32 |
if os.path.exists(index_html_path):
|
| 33 |
-
if os.path.exists('
|
| 34 |
-
os.remove('
|
| 35 |
shutil.move(index_html_path, '.')
|
| 36 |
|
| 37 |
# 静的ファイルをstaticディレクトリに移動
|
|
@@ -51,14 +51,14 @@ app = Flask(__name__)
|
|
| 51 |
@app.route('/')
|
| 52 |
def index():
|
| 53 |
# index.htmlが存在しない場合は404エラー
|
| 54 |
-
if not os.path.exists("
|
| 55 |
print("index 404")
|
| 56 |
return abort(404, description="index.html not found.")
|
| 57 |
|
| 58 |
# index.htmlの内容を読み込む
|
| 59 |
-
with open("
|
| 60 |
index_html_content = file.read()
|
| 61 |
-
print("
|
| 62 |
|
| 63 |
return render_template_string(index_html_content)
|
| 64 |
|
|
|
|
| 28 |
os.system("npm start")
|
| 29 |
|
| 30 |
# index.htmlをカレントディレクトリに移動
|
| 31 |
+
index_html_path = os.path.join(temp_dir, 'index.html')
|
| 32 |
if os.path.exists(index_html_path):
|
| 33 |
+
if os.path.exists('index.html'):
|
| 34 |
+
os.remove('index.html')
|
| 35 |
shutil.move(index_html_path, '.')
|
| 36 |
|
| 37 |
# 静的ファイルをstaticディレクトリに移動
|
|
|
|
| 51 |
@app.route('/')
|
| 52 |
def index():
|
| 53 |
# index.htmlが存在しない場合は404エラー
|
| 54 |
+
if not os.path.exists("index.html"):
|
| 55 |
print("index 404")
|
| 56 |
return abort(404, description="index.html not found.")
|
| 57 |
|
| 58 |
# index.htmlの内容を読み込む
|
| 59 |
+
with open("index.html", "r") as file:
|
| 60 |
index_html_content = file.read()
|
| 61 |
+
print("index.htmlok")
|
| 62 |
|
| 63 |
return render_template_string(index_html_content)
|
| 64 |
|