summaryrefslogtreecommitdiff
path: root/animism-align/cli
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-11-16 17:12:36 +0100
committerJules Laplace <julescarbon@gmail.com>2020-11-16 17:12:36 +0100
commit45d27cf690dc2a564563aebf5488e297255e5735 (patch)
tree09a4cba7210c0a4f11639ec5193b0d42f46b2929 /animism-align/cli
parent92881093ae19e4d76193447c187028aee5cbe4c7 (diff)
document, remove stray console logs!
Diffstat (limited to 'animism-align/cli')
-rw-r--r--animism-align/cli/app/server/viewer.py36
1 files changed, 3 insertions, 33 deletions
diff --git a/animism-align/cli/app/server/viewer.py b/animism-align/cli/app/server/viewer.py
index 3eecc4e..c5496f5 100644
--- a/animism-align/cli/app/server/viewer.py
+++ b/animism-align/cli/app/server/viewer.py
@@ -18,7 +18,8 @@ from app.settings import app_cfg
def create_app(script_info=None):
"""
- functional pattern for creating the flask app
+ Instantiate a standalone viewer of an exported build.
+ Used because Flask is better than SimpleHTTPServer at serving media.
"""
logging.debug("Starting site viewer...")
# print(app_cfg.SERVER_NAME)
@@ -26,41 +27,10 @@ def create_app(script_info=None):
app.config['SERVER_NAME'] = app_cfg.SERVER_NAME
app.url_map.strict_slashes = False
- # index_html = 'site.html'
-
- # @app.route('/episode1', methods=['GET'])
- # def serve_dir_directory_index():
- # return send_from_directory(app_cfg.DIR_STATIC_SITE_VIEWER, 'episode1/index.html')
-
- # @app.errorhandler(404)
- # def page_not_found(e):
- # filename = request.url.replace(app_cfg.SERVER_NAME, '')
- # print(filename)
- # # return app.send_static_file(index_html), 200
-
- # @app.route('/<path:filename>', methods=['GET'])
- # def serve_file_in_dir(filename):
- # print(filename)
- # if os.path.isfile(os.path.join(app_cfg.DIR_STATIC_SITE_VIEWER, filename)):
- # return send_from_directory(app_cfg.DIR_STATIC_SITE_VIEWER, filename)
- # if os.path.isfile(os.path.join(app_cfg.DIR_STATIC_SITE_VIEWER, filename, 'index.html')):
- # filename = os.path.join(filename, 'index.html')
- # return send_from_directory(app_cfg.DIR_STATIC_SITE_VIEWER, filename)
- # return 404
-
- # return app.send_static_file(index_html), 200
- # path = os.path.join(os.path.dirname(__file__), 'site.html')
- # with open(path, "r") as f:
- # return f.read(), 200
-
- # @app.route('/', methods=['GET'])
- # def index():
- # return app.send_static_file('site.html')
-
@app.route('/favicon.ico')
def favicon():
return send_from_directory(os.path.join(app.root_path, 'static/img/'),
- 'favicon.ico',mimetype='image/vnd.microsoft.icon')
+ 'favicon.ico', mimetype='image/vnd.microsoft.icon')
@app.shell_context_processor
def shell_context():