Changeset View
Changeset View
Standalone View
Standalone View
swh/search/cli.py
Show First 20 Lines • Show All 119 Lines • ▼ Show 20 Lines | @click.option( | ||||
"--debug/--nodebug", | "--debug/--nodebug", | ||||
default=True, | default=True, | ||||
help="Indicates if the server should run in debug mode", | help="Indicates if the server should run in debug mode", | ||||
) | ) | ||||
def rpc_server(config_path, host, port, index_prefix, debug): | def rpc_server(config_path, host, port, index_prefix, debug): | ||||
"""Starts a Software Heritage Indexer RPC HTTP server.""" | """Starts a Software Heritage Indexer RPC HTTP server.""" | ||||
from .api.server import app, load_and_check_config | from .api.server import app, load_and_check_config | ||||
api_cfg = load_and_check_config(config_path, type="any") | api_cfg = load_and_check_config(config_path) | ||||
app.config.update(api_cfg) | app.config.update(api_cfg) | ||||
app.run(host, port=int(port), index_prefix=index_prefix, debug=bool(debug)) | app.run(host, port=int(port), index_prefix=index_prefix, debug=bool(debug)) |