Apparently, APPLICATION_ROOT does something.

This commit is contained in:
Aaron Louie 2020-05-24 00:05:13 -04:00
parent 68084a84cf
commit 4eaee57076
3 changed files with 5 additions and 5 deletions

View File

@ -14,7 +14,7 @@ TESTING = environ.get('TESTING', default="false") == "true"
PRODUCTION = (environ.get('PRODUCTION', default="false") == "true") or (not DEVELOPMENT and not TESTING)
# Add trailing slash to base path
BASE_HREF = re.sub(r'//', '/', '/%s/' % environ.get('BASE_HREF', default="/").strip('/'))
APPLICATION_ROOT = re.sub(r'//', '/', '/%s/' % environ.get('APPLICATION_ROOT', default="/").strip('/'))
DB_HOST = environ.get('DB_HOST', default="localhost")
DB_PORT = environ.get('DB_PORT', default="5432")
@ -48,5 +48,5 @@ print('TESTING = ', TESTING)
print('PRODUCTION = ', PRODUCTION)
print('PB_BASE_URL = ', PB_BASE_URL)
print('LDAP_URL = ', LDAP_URL)
print('BASE_HREF = ', BASE_HREF)
print('APPLICATION_ROOT = ', APPLICATION_ROOT)

View File

@ -34,7 +34,7 @@ ma = Marshmallow(app)
from crc import models
from crc import api
connexion_app.add_api('api.yml', base_path=app.config['BASE_HREF'] + 'v1.0')
connexion_app.add_api('api.yml', base_path='/v1.0')
# Convert list of allowed origins to list of regexes
origins_re = [r"^https?:\/\/%s(.*)" % o.replace('.', '\.') for o in app.config['CORS_ALLOW_ORIGINS']]

View File

@ -32,7 +32,7 @@ def verify_token(token):
def get_current_user():
return UserModelSchema().dump(g.user)
@app.route(app.config['BASE_HREF'] + 'v1.0/login')
@app.route('/v1.0/login')
def sso_login():
# This what I see coming back:
# X-Remote-Cn: Daniel Harold Funk (dhf8r)
@ -67,7 +67,7 @@ def sso_login():
return _handle_login(info, redirect)
@app.route(app.config['BASE_HREF'] + 'sso')
@app.route('/sso')
def sso():
response = ""
response += "<h1>Headers</h1>"