diff options
Diffstat (limited to 'plugin/example_hello_world_test.go')
-rw-r--r-- | plugin/example_hello_world_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugin/example_hello_world_test.go b/plugin/example_hello_world_test.go new file mode 100644 index 000000000..5dea28823 --- /dev/null +++ b/plugin/example_hello_world_test.go @@ -0,0 +1,20 @@ +package plugin_test + +import ( + "fmt" + "net/http" + + "github.com/mattermost/mattermost-server/plugin/rpcplugin" +) + +type HelloWorldPlugin struct{} + +func (p *HelloWorldPlugin) ServeHTTP(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hello, world!") +} + +// This example demonstrates a plugin that handles HTTP requests which respond by greeting the +// world. +func Example_helloWorld() { + rpcplugin.Main(&HelloWorldPlugin{}) +} |