Slackbox.ResponsePlug (Slackbox v0.1.0)

Copy Markdown View Source

A Plug.Router a host app mounts to receive Slack response_url callbacks.

In the inbound simulation loop, Slackbox.Simulator hands the app a response_url of the form <response_base>/<token>. When the app POSTs its Slack response there (a JSON body like %{"text" => ..., "blocks" => ...}), this plug decodes it and calls Slackbox.Store.apply_response/2, updating the originating message and broadcasting the change to the dashboard.

Mount it at the same path you use for response_base, e.g.:

forward "/slackbox/response", Slackbox.ResponsePlug

paired with response_base: "http://localhost:4000/slackbox/response".

Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Functions

call(conn, opts)

Callback implementation for Plug.call/2.

init(opts)

Callback implementation for Plug.init/1.