Commit 3414bdc1 authored by Manuel's avatar Manuel

businessLogic: updated local mode

parent cfa062b9
......@@ -12,6 +12,7 @@ if os.path.exists(modules_path):
# load swagger config
import connexion
from security import swagger_util
from env_info import is_running_locally
app = connexion.App(__name__, specification_dir='configs/')
......@@ -28,16 +29,17 @@ except KeyError:
certificate_path = '/srv/articonf/'
context = (os.path.normpath(f'{certificate_path}/articonf1.crt'), os.path.normpath(f'{certificate_path}/articonf1.key')) # certificate and key files
# Local Mode
try:
if is_running_locally():
# Local Mode
print("Running with local settings...")
local = os.environ['ARTICONF_LOCAL']
app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger_local.yml")),
resolver = connexion.RestyResolver("cms_rest_api"))
except KeyError:
context = 'adhoc'
else:
app.add_api(swagger_util.get_bundled_specs(Path("configs/swagger.yml")),
resolver = connexion.RestyResolver("cms_rest_api"))
# start app
if __name__ == '__main__':
print(context)
app.run(host='0.0.0.0', port=5000, debug=False, ssl_context=context)
......@@ -2,11 +2,13 @@ astroid==2.4.2
attrs==19.3.0
autopep8==1.5.4
certifi==2020.6.20
cffi==1.14.2
chardet==3.0.4
click==7.1.2
clickclick==1.2.2
colorama==0.4.3
connexion==2.7.0
cryptography==3.1
Flask==1.1.2
idna==2.10
importlib-metadata==1.7.0
......@@ -21,11 +23,13 @@ mccabe==0.6.1
openapi-spec-validator==0.2.9
prance==0.19.0
pycodestyle==2.6.0
pycparser==2.20
pylint==2.5.3
pymongo==3.11.0
pyrsistent==0.16.0
PyYAML==5.3.1
requests==2.24.0
rope==0.17.0
semver==2.10.2
six==1.15.0
swagger-ui-bundle==0.0.8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment