-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathswing_main.py
40 lines (29 loc) · 1.17 KB
/
swing_main.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
from flask import Flask
from instance.config_app import configType as cfgapp
from instance.config_firebase import configType as cfgfirebase
from instance.config_models import configType as cfgmodels
# Enables Instance Folder Configuration (instance_relative_config=True)
app = Flask(__name__, instance_relative_config=True)
# Configuration Files From Instance Folder
cfgType = app.config['ENV']
app.config.from_object(cfgapp[cfgType])
app.config.from_object(cfgfirebase[cfgType])
app.config.from_object(cfgmodels[cfgType])
app.logger.info("** SWING_CMS ** - CONFIG: {}".format(app.config))
with app.app_context():
from views.api import api as api_view
from views.home import home as home_view
from views.seo import seo as seo_view
from views.socketio import sio as sio_view
# API Fetchs
app.register_blueprint(api_view)
# Home
app.register_blueprint(home_view)
# Search Engine Optimization - SEO
app.register_blueprint(seo_view)
# SocketIO Events
app.register_blueprint(sio_view)
# Register the Service Worker
@app.route('/sw.js', methods=['GET'])
def serviceworker():
return app.send_static_file('js/sw.js')