File size: 668 Bytes
5312808
 
 
63e1b1c
 
 
 
 
 
 
 
 
 
 
5312808
 
 
 
 
 
 
 
 
9d93a57
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
from flask import Flask, send_from_directory

# リポジトリのクローンを行う
def clone_repo():
    # 現在のディレクトリに`index.html`が存在しない場合のみクローンする
    if not os.path.exists('index.html'):
        print("Cloning the repository...")
        os.system("git clone https://github.com/ozh/cookieclicker.git .")
    else:
        print("Repository already cloned.")

# クローンを実行
clone_repo()

app = Flask(__name__)

# index.htmlをルートパスで表示
@app.route('/')
def index():
    return send_from_directory('.', 'index.html')

if __name__ == '__main__':
    app.run(debug=True, port=7860)