From 57537fe49f296dc14c513230fc1592604668e7a1 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Wed, 30 Jan 2019 13:58:32 +0000 Subject: [PATCH] Updated to new API routes --- docs/source/plugins/routes.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/plugins/routes.rst b/docs/source/plugins/routes.rst index e5023675..a7c2618b 100644 --- a/docs/source/plugins/routes.rst +++ b/docs/source/plugins/routes.rst @@ -21,7 +21,9 @@ For example, your ``api_views`` dictionary may look like: '/myplugin': MyRouteAPI, } -Here, ``MyRouteAPI`` is a web API plugin class, subclassing :py:class:`openflexure_microscope.api.v1.views.MicroscopeViewPlugin`. If your plugin package were named ``mypluginpackage``, an API route would be automatically added at ``/api/v1/plugin/mypluginpackage/myplugin``. +Here, ``MyRouteAPI`` is a web API plugin class, subclassing :py:class:`openflexure_microscope.api.v1.views.MicroscopeViewPlugin`. If your plugin package were named ``myplugins.package``, an API route would be automatically added at ``/api/v1/plugin/myplugins/package/myplugin``. + +The full URL that your plugin will attach to is essentially identical to it's full module path. That is, if your plugin is loaded from ``my_microscope_plugins.mypluginpackage:MyPluginClass``, then your plugin routes will appear at ``/plugin/my_microscope_plugins/mypluginpackage/``. While this means that plugin routes can get long very quickly, they will generally only ever be accessed by client applications, and so this generally should not be a problem. The MicroscopeViewPlugin class ------------------------------