From c4095d9bafdbb88234bb44fcdb9464a7c2cc1447 Mon Sep 17 00:00:00 2001 From: Matt Burchett Date: Thu, 4 Feb 2021 02:29:28 -0600 Subject: [PATCH] Slack endpoint. --- README.md | 4 ++++ pkg/server/server.go | 1 + 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 8a1ebf2..98dc7ad 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,7 @@ ### Usage > POST /generic/{matrixRoom}/{matrixUser}/{matrixPassword} This is a generic handler that will accept any form of data and pass it through to Matrix using the appropriate JSON format. + +### Usage +> POST /slack/{matrixRoom}/{matrixUser}/{matrixPassword} +This is a Slack-friendly handler that will accept any form of Slack data and pass through just the text to Matrix using the appropriate JSON format. diff --git a/pkg/server/server.go b/pkg/server/server.go index 8d4cbb3..d246c5e 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -32,6 +32,7 @@ func Run(info *router.BuildInfo) error { router := router.NewRouter(info) router.HandleWithMetrics("/generic/{matrixRoom}/{matrixUser}/{matrixPassword}", generic.Handle(conf)).Methods(http.MethodPost) + router.HandleWithMetrics("/slack/{matrixRoom}/{matrixUser}/{matrixPassword}", generic.Handle(conf)).Methods(http.MethodPost) srv := http.Server{ Addr: fmt.Sprintf(":%d", conf.Port),