Fix URL hosts

This commit is contained in:
Joshua Boniface 2019-12-23 21:17:30 -05:00
parent 142e1f186d
commit 914b3d84e1
2 changed files with 2 additions and 6 deletions

View File

@ -207,14 +207,10 @@ api.add_resource(API_Root, '/')
# /doc
class API_Doc(Resource):
def get(self):
if config['ssl_enabled']:
scheme = 'https'
else:
scheme = 'http'
swagger_data = swagger(pvc_api.app)
swagger_data['info']['version'] = API_VERSION
swagger_data['info']['title'] = "PVC Client and Provisioner API"
swagger_data['host'] = "{}://{}:{}".format(scheme, config['listen_address'], config['listen_port'])
swagger_data['host'] = "{}:{}".format(config['listen_address'], config['listen_port'])
return swagger_data
api.add_resource(API_Doc, '/doc')

View File

@ -19,7 +19,7 @@ swagger_file = "docs/manuals/swagger.json"
swagger_data = swagger(pvc_api.app)
swagger_data['info']['version'] = "1.0"
swagger_data['info']['title'] = "PVC Client and Provisioner API"
swagger_data['info']['url'] = "http://pvc.local:7570"
swagger_data['host'] = "pvc.local:7570"
with open(swagger_file, 'w') as fd:
fd.write(json.dumps(swagger_data, sort_keys=True, indent=4))