Started re-writing plugin documentation
This commit is contained in:
parent
367c68ad6f
commit
d681a2069d
7 changed files with 54 additions and 28 deletions
|
|
@ -7,14 +7,24 @@ import logging
|
|||
|
||||
|
||||
class IdentifyAPI(MicroscopeViewPlugin):
|
||||
|
||||
"""
|
||||
A simple example API plugin, attached through the main microscope plugin.
|
||||
"""
|
||||
def get(self):
|
||||
"""
|
||||
Method to call when an HTTP GET request is made.
|
||||
"""
|
||||
data = self.microscope.plugin.default.identify() # Call a method from our plugin, using the full route
|
||||
return Response(escape(data))
|
||||
|
||||
|
||||
class HelloWorldAPI(MicroscopeViewPlugin):
|
||||
|
||||
"""
|
||||
An even simpler example API plugin, which just returns static data without using the microscope.
|
||||
"""
|
||||
def get(self):
|
||||
"""
|
||||
Method to call when an HTTP GET request is made.
|
||||
"""
|
||||
data = self.plugin.hello_world() # Call a method from our plugin, using the MicroscopeViewPlugin.plugin shortcut
|
||||
return Response(data)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue