summaryrefslogtreecommitdiffstats
path: root/plugin/example_hello_world_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/example_hello_world_test.go')
-rw-r--r--plugin/example_hello_world_test.go20
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..955c6df3c
--- /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"
+)
+
+type HelloWorldPlugin struct{}
+
+func (p *HelloWorldPlugin) ServeHTTP(c *plugin.Context, 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() {
+ plugin.ClientMain(&HelloWorldPlugin{})
+}