-
Notifications
You must be signed in to change notification settings - Fork 2
/
app.py
55 lines (41 loc) · 1000 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
from flask import Flask, send_file
app = Flask(__name__)
TYPES = [
'bullet',
'blitz',
'rapid',
'classical',
'correspondence',
'antichess',
'atomic',
'chess960',
'crazyhouse',
'horde',
'kingOfTheHill',
'racingKings',
'threeCheck'
]
@app.route('/')
@app.route('/home')
def welcome_page():
return send_file('html/Home.html')
@app.route('/bot')
def bot():
return send_file('html/Bot.html')
@app.route('/originals')
def originals():
return send_file('html/Originals.html')
@app.route('/bot/<type_name>')
def bot_type(type_name):
if type_name in TYPES:
return send_file(f'bot_leaderboard/{type_name}.html')
else:
return "Invalid type", 404
@app.route('/originals/<type_name>')
def originals_type(type_name):
if type_name in TYPES:
return send_file(f'originals/{type_name}.html')
else:
return "Invalid type", 404
if __name__ == "__main__":
app.run(host="localhost", port=5000)