-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
71 lines (64 loc) · 1.63 KB
/
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
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('index.html')
@app.route('/lichess')
def lichess():
return send_file('html/lichess.html')
@app.route('/lichess/<type_name>')
def chess_bot_type(type_name):
if type_name in TYPES:
return send_file(f'lichess/{type_name}.html')
else:
return "Loại không hợp lệ", 404
#@app.route('/lishogi')
#def lishogi():
# return send_file('html/lishogi.html')
#
#@app.route('/lishogi/<type_name>')
#def shogi_bot_type(type_name):
# if type_name in TYPES:
# return send_file(f'lishogi/{type_name}.html')
# else:
# return "Loại không hợp lệ", 404
#
#@app.route('/playstrategy')
#def playstrategy():
# return send_file('html/playstrategy.html')
#
#@app.route('/playstrategy/<type_name>')
#def strategy_bot_type(type_name):
# if type_name in TYPES:
# return send_file(f'playstrategy/{type_name}.html')
# else:
# return "Loại không hợp lệ", 404
#
#@app.route('/lidraughts')
#def lidraughts():
# return send_file('html/lidraughts.html')
#
#@app.route('/lidraughts/<type_name>')
#def draughts_bot_type(type_name):
# if type_name in TYPES:
# return send_file(f'lidraughts/{type_name}.html')
# else:
# return "Loại không hợp lệ", 404
if __name__ == "__main__":
app.run(host="localhost", port=5000)