Use the URL scheme and use the host in the other discovery url.

This commit is contained in:
jakedt 2014-03-26 16:37:28 -04:00
parent 0a80f67355
commit 4a4ea52041

View file

@ -23,6 +23,9 @@ TYPE_CONVERTER = {
int: 'integer', int: 'integer',
} }
URL_SCHEME = app.config['URL_SCHEME']
URL_HOST = app.config['URL_HOST']
def fully_qualified_name(method_view_class): def fully_qualified_name(method_view_class):
inst = method_view_class() inst = method_view_class()
@ -140,7 +143,7 @@ def swagger_route_data(include_internal=False, compact=False):
swagger_data = { swagger_data = {
'apiVersion': 'v1', 'apiVersion': 'v1',
'swaggerVersion': '1.2', 'swaggerVersion': '1.2',
'basePath': 'http://localhost:5000', 'basePath': '%s://%s' % (URL_SCHEME, URL_HOST),
'resourcePath': '/', 'resourcePath': '/',
'info': { 'info': {
'title': 'Quay.io API', 'title': 'Quay.io API',
@ -157,7 +160,7 @@ def swagger_route_data(include_internal=False, compact=False):
"implicit": { "implicit": {
"tokenName": "access_token", "tokenName": "access_token",
"loginEndpoint": { "loginEndpoint": {
"url": "http://%s/oauth/authorize" % app.config['URL_HOST'], "url": "%s://%s/oauth/authorize" % (URL_SCHEME, URL_HOST),
}, },
}, },
}, },