soiz commited on
Commit
1136977
·
verified ·
1 Parent(s): 5861b80

Update app.py

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