Viberex v0.2.0 Viberex.Plug View Source

Plug that handle message from Viber.

Usage

Add to your router

scope "/webhook" do
  forward "/viber",
    Viberex.Plug,
    handler: &MyApp.Handler.handle/1
end

And define handler. The handle function must return :noreply or {:reply, message} if callback wait response, e.g. welcome message.

defmodule MyApp.Handler do
  def handle(message) do
    IO.inspect(message)
    :noreply
  end
end

Link to this section Summary

Functions

Callback implementation for Plug.call/2

Callback implementation for Plug.init/1

Link to this section Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.