summaryrefslogtreecommitdiff
path: root/megapixels/app/server/create.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-12-16 00:11:20 +0100
committerJules Laplace <julescarbon@gmail.com>2018-12-16 00:11:20 +0100
commit3b10acc73247ec703ed47f0423e7d255a91f074e (patch)
treefd1a86c51858a3a69d6181f60499dd7953b960a9 /megapixels/app/server/create.py
parentf1461ec2727f26dacaf21a03d8698cf3f674c2cf (diff)
tabulator
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)