Slack endpoint.

This commit is contained in:
Matt Burchett 2021-02-04 02:29:28 -06:00
parent fd947ac105
commit c4095d9baf
2 changed files with 5 additions and 0 deletions

View File

@ -3,3 +3,7 @@
### Usage ### Usage
> POST /generic/{matrixRoom}/{matrixUser}/{matrixPassword} > 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. 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.

View File

@ -32,6 +32,7 @@ func Run(info *router.BuildInfo) error {
router := router.NewRouter(info) router := router.NewRouter(info)
router.HandleWithMetrics("/generic/{matrixRoom}/{matrixUser}/{matrixPassword}", generic.Handle(conf)).Methods(http.MethodPost) 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{ srv := http.Server{
Addr: fmt.Sprintf(":%d", conf.Port), Addr: fmt.Sprintf(":%d", conf.Port),