From 5a89cc6a2ad6f5949620c61bea3e3a62c5c14f2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 26 May 2015 14:29:22 +0200 Subject: [PATCH] [doc] Added example for the octoprint.server.http.routes hook --- docs/plugins/hooks.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/plugins/hooks.rst b/docs/plugins/hooks.rst index 039b5601..7902b0ea 100644 --- a/docs/plugins/hooks.rst +++ b/docs/plugins/hooks.rst @@ -322,6 +322,14 @@ octoprint.server.http.routes **Example** + The following example registers two new routes ``/plugin/add_tornado_route/download`` and ``/plugin/add_tornado_route/forward`` + in the webserver which roughly replicate the functionality of ``/downloads/files/local`` and ``/downloads/camera/current``. + + .. onlineinclude:: https://raw.githubusercontent.com/OctoPrint/Plugin-Examples/master/add_tornado_route.py + :linenos: + :tab-width: 4 + :caption: `add_tornado_route.py `_ + .. seealso:: :class:`~octoprint.server.util.tornado.LargeResponseHandler`