1212from apis .openaire import openaire_ns
1313from apis .create_vis import vis_ns
1414
15- import settings
1615from utils .monkeypatches import ReverseProxied , __schema__ , specs_url , _register_apidoc
1716import logging
1817
1918
20- def api_patches (app , settings ):
19+ def api_patches (app ):
2120 Api ._register_apidoc = _register_apidoc
2221 Api .__schema__ = __schema__
2322 Api .specs_url = specs_url
@@ -29,20 +28,19 @@ def api_patches(app, settings):
2928 version = "0.1" ,
3029 prefix = '/api' ,
3130 doc = "/docs" )
32- if settings . BEHIND_PROXY :
31+ if os . getenv ( " BEHIND_PROXY" ) == "True" :
3332 api_fixed .behind_proxy = True
3433 return api_fixed
3534
3635
3736app = Flask ('v1' , instance_relative_config = True )
38- app .config .from_object ('settings' )
3937handler = logging .StreamHandler (sys .stdout )
4038handler .setLevel (app .logger .level )
4139app .wsgi_app = ProxyFix (app .wsgi_app , x_proto = 1 , x_port = 1 , x_for = 1 , x_host = 1 , x_prefix = 1 )
4240app .wsgi_app = ReverseProxied (app .wsgi_app )
4341CORS (app , expose_headers = ["Content-Disposition" , "Access-Control-Allow-Origin" ])
4442
45- api = api_patches (app , settings )
43+ api = api_patches (app )
4644api .add_namespace (triple_ns , path = '/triple' )
4745api .add_namespace (gsheets_ns , path = '/gsheets' )
4846api .add_namespace (base_ns , path = '/base' )
0 commit comments