langflow/langflow/server.py
ogabrielluiz 48cb3b06ca style: ruff
2023-03-09 14:13:15 -03:00

20 lines
563 B
Python

from gunicorn.app.base import BaseApplication
class LangflowApplication(BaseApplication):
def __init__(self, app, options=None):
self.options = options or {}
self.application = app
super().__init__()
def load_config(self):
config = {
key: value
for key, value in self.options.items()
if key in self.cfg.settings and value is not None
}
for key, value in config.items():
self.cfg.set(key.lower(), value)
def load(self):
return self.application