--- /dev/null
+""" Copyright (c) 2019 AT&T Intellectual Property. #\r
+# #\r
+# Licensed under the Apache License, Version 2.0 (the "License"); #\r
+# you may not use this file except in compliance with the License. #\r
+# You may obtain a copy of the License at #\r
+# #\r
+# http://www.apache.org/licenses/LICENSE-2.0 #\r
+# #\r
+# Unless required by applicable law or agreed to in writing, software #\r
+# distributed under the License is distributed on an "AS IS" BASIS, #\r
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #\r
+# See the License for the specific language governing permissions and #\r
+# limitations under the License. #\r
+#############################################################################"""\r
+\r
+\r
+from flask import Flask\r
+from app.routes import *\r
+from app import database\r
+\r
+\r
+def create_app():\r
+ # create Flask application\r
+ app = Flask(__name__)\r
+\r
+ # apply configuration\r
+ app.config.from_object(os.environ['APP_SETTINGS'])\r
+ app.config['g_database'] = None\r
+ app.config['g_base_folder'] = os.path.join(os.getcwd(), 'files')\r
+ app.config['g_data_folder'] = os.path.join(app.config['g_base_folder'], 'data')\r
+ app.config['g_working_folder'] = os.path.join(app.config['g_base_folder'], 'results')\r
+\r
+ # register all routes on the APPLICATION_ROOT\r
+ app.register_blueprint(routes, url_prefix=app.config['APPLICATION_ROOT'])\r
+\r
+ return app\r