Routes Codat webhook events to multiple handlers based on event type patterns.
Example
defmodule MyApp.CodatWebhooks do
use Codat.Webhooks.Dispatcher
on ["invoices.write.successful", "invoices.write.unsuccessful"],
to: MyApp.InvoiceSyncHandler
on ~r/^billPayments\.write\./,
to: MyApp.BillingHandler
on :all, to: MyApp.AuditLogHandler
endUse as the :handler in Codat.Webhooks.Plug:
forward "/webhooks/codat", Codat.Webhooks.Plug,
secret: "whsec_...",
handler: MyApp.CodatWebhooks
Summary
Functions
Registers a route mapping event type(s) to a handler module.