2021-11-08 16:39:01 +00:00
|
|
|
from threading import Thread
|
|
|
|
|
|
|
|
from flask import Flask, render_template
|
|
|
|
|
2021-11-13 14:54:59 +00:00
|
|
|
from orochi.config import Config
|
2021-11-08 16:39:01 +00:00
|
|
|
from orochi.models import Game
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/')
|
|
|
|
def index():
|
|
|
|
game = Game.INSTANCE
|
|
|
|
return render_template('list.html', game=game)
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/admin')
|
|
|
|
def admin():
|
|
|
|
game = Game.INSTANCE
|
|
|
|
return render_template('list.html', game=game, admin=True)
|
|
|
|
|
|
|
|
|
2021-11-13 14:54:59 +00:00
|
|
|
def run_web_server(config: Config):
|
|
|
|
Thread(target=lambda: app.run(host=config.http_host,
|
|
|
|
port=config.http_port,
|
|
|
|
debug=config.http_debug,
|
|
|
|
use_reloader=False)).start()
|