-
-
Save Rukenshia/9688dca4d3af63188ae45185f1a65f4d to your computer and use it in GitHub Desktop.
Webhook Issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Luggas do | |
use Plug.Router | |
plug Plug.Logger, log: :debug | |
plug Plug.Parsers, parsers: [:json], | |
pass: ["text/*"], | |
json_decoder: Poison | |
plug :match | |
plug :dispatch | |
post "/webhook" do | |
# curl -X POST -H 'Content-Type: application/json' -d '{"foo": "bar"}' localhost:4000/webhook | |
# curl output: none, status code 500 | |
# log: 15:57:36.818 [debug] POST /_telegram | |
# no "Sent in" log message | |
IO.puts "at least I'm getting called" | |
send_resp(conn, 200, "???") | |
end | |
match _ do | |
send_resp(conn, 400, "hi") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment