-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.py
More file actions
42 lines (27 loc) · 776 Bytes
/
app.py
File metadata and controls
42 lines (27 loc) · 776 Bytes
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
import os
from flask import Flask, render_template, send_from_directory
#-----------------------------
# initialization
# -----------------------------
app = Flask(__name__)
app.config.update(
DEBUG=True,
)
#------------------------------
#controllers
#------------------------------
@app.route('/favicon.ico')
def favicon():
return send_from_directory(os.path.join(app.root_path, 'static'), 'ico/favicon.ico')
@app.errorhandler(404)
def page_not_found(e):
return render_template('404.html'), 404
@app.route('/')
def base():
return render_template('index.html')
#------------------------------
#launch
#------------------------------
if __name__ == "__main__":
port = int(os.environ.get("PORT", 5000))
app.run(host="0.0.0.0", port=port)