cookie / app.py
soiz's picture
Update app.py
9d93a57 verified
raw
history blame
668 Bytes
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)