forked from rwv/chinese-dos-games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
31 lines (19 loc) · 755 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
from flask import Flask
from flask import render_template, redirect, url_for
from game_infos import game_infos
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html', games=game_infos['games'])
@app.route('/about')
def about():
return render_template('about.html', games=game_infos['games'])
@app.route('/games/<identifier>/')
def game(identifier):
game_info = game_infos["games"][identifier]
return render_template('game.html', game_info=game_info)
@app.route('/games/<identifier>/logo/emularity_color_small.png')
def emularity_logo(identifier):
return redirect(url_for('static', filename='emularity/emularity_color_small.png'), code=301)
if __name__ == '__main__':
app.run(debug=True)