diff --git a/docs/config.rst b/docs/config.rst index b21c1c6b..54c0377e 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -491,6 +491,13 @@ If you want to add a webservice (endpoint), add, for example: You can use code for webservices in `webservice.py `__ as inspiration. +To remove a :ref:`default webservice`, set it to empty: + +.. code-block:: ini + + [services] + daemonstatus.json = + .. _config-settings: settings section (scrapy.cfg) diff --git a/scrapyd/website.py b/scrapyd/website.py index 58c3d8ab..8772ad95 100644 --- a/scrapyd/website.py +++ b/scrapyd/website.py @@ -147,8 +147,9 @@ def __init__(self, config, app): self.putChild(b"items", File(self.items_dir, "text/plain")) for service_name, service_path in config.items("services", default=[]): - service_cls = load_object(service_path) - self.putChild(service_name.encode(), service_cls(self)) + if service_path: + service_cls = load_object(service_path) + self.putChild(service_name.encode(), service_cls(self)) # Add web UI last, since its behavior can depend on others' presence. self.putChild(b"", Home(self))