-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathapp.py
More file actions
32 lines (23 loc) · 766 Bytes
/
app.py
File metadata and controls
32 lines (23 loc) · 766 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
from flask import Flask, render_template, send_from_directory
from flask_static_digest import FlaskStaticDigest
from database import db_session
from api.v1.basic import basic_route
flask_static_digest = FlaskStaticDigest()
app = Flask(__name__, static_url_path='/static')
apiRoute = '/api/v1'
app.config.update(
DEBUG=True,
)
flask_static_digest.init_app(app)
@app.route('/dist/<path:path>')
def send_js(path):
return send_from_directory('webkit-build', path)
@app.route('/')
@app.route('/<section>')
def home(section="top"):
return render_template('app.html', section=section)
# Register REST API routes
app.register_blueprint(basic_route, url_prefix=apiRoute)
@app.teardown_appcontext
def shutdown_session(exception=None):
db_session.remove()