mirror of
https://github.com/Tanmoy741127/lumi.git
synced 2022-12-02 00:02:32 +03:00
21 lines
621 B
Python
21 lines
621 B
Python
import gunicorn.app.base
|
|
|
|
'''
|
|
Development server for RPC
|
|
In production, use gunicorn daemon to manage the server.
|
|
'''
|
|
class DevelopmentServer(gunicorn.app.base.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
|