Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ def clone_and_setup_repo():
|
|
| 13 |
shutil.rmtree(temp_dir)
|
| 14 |
|
| 15 |
print("Cloning the repository...")
|
| 16 |
-
result = os.system(f"git clone https://github.com/
|
| 17 |
|
| 18 |
if result != 0:
|
| 19 |
print("Error: Failed to clone the repository.")
|
|
@@ -22,9 +22,10 @@ def clone_and_setup_repo():
|
|
| 22 |
# クローンしたディレクトリに移動してセットアップ
|
| 23 |
os.chdir(temp_dir)
|
| 24 |
os.system("npm i")
|
| 25 |
-
os.system("cp
|
|
|
|
| 26 |
os.system("npm run build")
|
| 27 |
-
os.system("
|
| 28 |
|
| 29 |
# index.htmlをカレントディレクトリに移動
|
| 30 |
index_html_path = os.path.join(temp_dir, 'index.html')
|
|
@@ -51,11 +52,13 @@ app = Flask(__name__)
|
|
| 51 |
def index():
|
| 52 |
# index.htmlが存在しない場合は404エラー
|
| 53 |
if not os.path.exists("index.html"):
|
|
|
|
| 54 |
return abort(404, description="index.html not found.")
|
| 55 |
|
| 56 |
# index.htmlの内容を読み込む
|
| 57 |
with open("index.html", "r") as file:
|
| 58 |
index_html_content = file.read()
|
|
|
|
| 59 |
|
| 60 |
return render_template_string(index_html_content)
|
| 61 |
|
|
|
|
| 13 |
shutil.rmtree(temp_dir)
|
| 14 |
|
| 15 |
print("Cloning the repository...")
|
| 16 |
+
result = os.system(f"git clone https://github.com/titaniumnetwork-dev/incognito.git --recursive {temp_dir}")
|
| 17 |
|
| 18 |
if result != 0:
|
| 19 |
print("Error: Failed to clone the repository.")
|
|
|
|
| 22 |
# クローンしたディレクトリに移動してセットアップ
|
| 23 |
os.chdir(temp_dir)
|
| 24 |
os.system("npm i")
|
| 25 |
+
os.system("cp .env.example .env")
|
| 26 |
+
os.system("nano .env")
|
| 27 |
os.system("npm run build")
|
| 28 |
+
os.system("npm start")
|
| 29 |
|
| 30 |
# index.htmlをカレントディレクトリに移動
|
| 31 |
index_html_path = os.path.join(temp_dir, 'index.html')
|
|
|
|
| 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 |
|