summaryrefslogtreecommitdiff
path: root/megapixels/app/server/create.py
diff options
context:
space:
mode:
Diffstat (limited to 'megapixels/app/server/create.py')
-rw-r--r--megapixels/app/server/create.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/megapixels/app/server/create.py b/megapixels/app/server/create.py
index c1f41dc4..4b1333b9 100644
--- a/megapixels/app/server/create.py
+++ b/megapixels/app/server/create.py
@@ -7,6 +7,9 @@ from app.server.api import api
db = SQLAlchemy()
def create_app(script_info=None):
+ """
+ functional pattern for creating the flask app
+ """
app = Flask(__name__, static_folder='static', static_url_path='')
app.config['SQLALCHEMY_DATABASE_URI'] = connection_url
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
@@ -37,6 +40,10 @@ def create_app(script_info=None):
return app
def serve_page(file_relative_path_to_root):
+ """
+ trying to get this to serve /path/ with /path/index.html,
+ ...but it doesnt actually matter for production...
+ """
if file_relative_path_to_root[-1] == '/':
file_relative_path_to_root += 'index.html'
return send_from_directory("static", file_relative_path_to_root)