refactor flask_cors as optional

This commit is contained in:
Tom Kralidis
2018-05-03 19:57:37 +00:00
parent 6d4a58b454
commit 67025c249d
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -11,6 +11,6 @@ Package: python-pygeoapi
Architecture: all
Depends: ${misc:Depends}, ${python:Depends}, python-pkg-resources, python-click, python-flask, python-yaml
Suggests: python-elasticsearch, python-geojson, python-shapely
Homepage: https://github.com/geopython/pygeoapi.git
Homepage: https://github.com/geopython/pygeoapi
Description: pygeoapi provides an API to geospatial
data
+2 -2
View File
@@ -34,7 +34,6 @@ import click
import yaml
from flask import Flask, make_response, request
from flask_cors import CORS
from pygeoapi.api import API
@@ -130,7 +129,8 @@ def serve(ctx, debug=False):
if not api_.config['server']['pretty_print']:
APP.config['JSONIFY_PRETTYPRINT_REGULAR'] = False
if api_.config['server']['cors']:
if 'cors' in api_.config['server'] and api_.config['server']['cors']:
from flask_cors import CORS
CORS(APP)
# setup_logger(CONFIG['logging'])
+1
View File
@@ -1,3 +1,4 @@
flask_cors
coverage==4.5.1
docutils==0.14
flake8==3.5.0
-1
View File
@@ -1,6 +1,5 @@
click
elasticsearch
Flask
Flask_Cors
PyYAML
Shapely