Skip to content
Snippets Groups Projects
Commit 203fa3f2 authored by Antoine Pietri's avatar Antoine Pietri
Browse files

api.server: add make_app_from_configfile() for gunicorn

parent 8fcef1f3
No related branches found
No related tags found
No related merge requests found
...@@ -16,6 +16,7 @@ from swh.vault.cookers import COOKER_TYPES ...@@ -16,6 +16,7 @@ from swh.vault.cookers import COOKER_TYPES
from swh.vault.backend import VaultBackend from swh.vault.backend import VaultBackend
DEFAULT_CONFIG_PATH = 'vault/server'
DEFAULT_CONFIG = { DEFAULT_CONFIG = {
'storage': ('dict', { 'storage': ('dict', {
'cls': 'local', 'cls': 'local',
...@@ -156,6 +157,10 @@ def make_app(config, **kwargs): ...@@ -156,6 +157,10 @@ def make_app(config, **kwargs):
return app return app
def make_app_from_configfile(config_path=DEFAULT_CONFIG_PATH, **kwargs):
return make_app(config.read(config_path, DEFAULT_CONFIG), **kwargs)
@click.command() @click.command()
@click.argument('config-path', required=1) @click.argument('config-path', required=1)
@click.option('--host', default='0.0.0.0', help="Host to run the server") @click.option('--host', default='0.0.0.0', help="Host to run the server")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment