implement bind configuration
This commit is contained in:
+4
-3
@@ -1,7 +1,8 @@
|
||||
server:
|
||||
host: localhost
|
||||
port: 5000
|
||||
basepath: /
|
||||
bind:
|
||||
host: localhost
|
||||
port: 5000
|
||||
url: http://geo.kralidis.ca/pygeoapi
|
||||
mimetype: application/json; charset=UTF-8
|
||||
encoding: utf-8
|
||||
language: en-US
|
||||
|
||||
@@ -39,7 +39,6 @@ from flask_cors import CORS
|
||||
from pygeoapi import views
|
||||
from pygeoapi.config import settings
|
||||
from pygeoapi.log import setup_logger
|
||||
from pygeoapi.util import get_url
|
||||
|
||||
APP = Flask(__name__)
|
||||
APP.url_map.strict_slashes = False
|
||||
@@ -129,8 +128,7 @@ def serve(ctx, debug=False):
|
||||
|
||||
setup_logger()
|
||||
# TODO: get scheme
|
||||
BASEURL = get_url('http', settings['server']['host'],
|
||||
settings['server']['port'],
|
||||
settings['server']['basepath'])
|
||||
BASEURL = settings['server']['url']
|
||||
APP.config['PYGEOAPI_BASEURL'] = BASEURL
|
||||
APP.run(debug=True, host='0.0.0.0', port=settings['server']['port'])
|
||||
APP.run(debug=True, host='0.0.0.0',
|
||||
port=settings['server']['bind']['port'])
|
||||
|
||||
+1
-4
@@ -69,11 +69,8 @@ def get_oas_30(cfg):
|
||||
}
|
||||
oas['info'] = info
|
||||
|
||||
url = 'http://{}'.format(cfg['server']['host'])
|
||||
if cfg['server']['port'] not in [80, 443]:
|
||||
url = '{}:{}'.format(url, cfg['server']['port'])
|
||||
oas['servers'] = [{
|
||||
'url': url,
|
||||
'url': cfg['server']['url'],
|
||||
'description': cfg['metadata']['identification']['description']
|
||||
}]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user