It is now possible to run the API with gunicorn using gunicorn -w 4 -b 0.0.0.0:8001 'bcnsGDSAPI:create_app()'. Also did other small changes.
48 lines
740 B
Python
48 lines
740 B
Python
languages = {}
|
|
app_language = ""
|
|
main = {}
|
|
api = {}
|
|
|
|
|
|
def init(config=None):
|
|
global main
|
|
global api
|
|
main = config["MAIN"]
|
|
api = config["API"]
|
|
|
|
|
|
def apihost():
|
|
return (
|
|
api["protocol"] + "://" +
|
|
api["host"] + ":" +
|
|
api["port"]
|
|
)
|
|
|
|
|
|
def set_languages(languages_dict):
|
|
global languages
|
|
languages = languages_dict
|
|
return True
|
|
|
|
|
|
def get_languages():
|
|
global languages
|
|
return languages
|
|
|
|
|
|
def set_apihost(new_apihost):
|
|
global apihost
|
|
apihost = new_apihost
|
|
return apihost
|
|
|
|
|
|
def get_apihost():
|
|
global apihost
|
|
return apihost
|
|
|
|
|
|
def set_applanguage(new_applanguage):
|
|
global app_language
|
|
app_language = new_applanguage
|
|
return app_language
|