Last active
June 28, 2017 14:35
-
-
Save AntonFagerberg/2b0e2759d2e03f3948d9 to your computer and use it in GitHub Desktop.
Elixir Plug form parser
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 Router do | |
use Plug.Router | |
plug Plug.Parsers, parsers: [:urlencoded, :json], | |
pass: ["text/*"], | |
json_decoder: Poison | |
plug :match | |
plug :dispatch | |
post "test" do | |
IO.inspect conn.params # <-- Map with params | |
send_resp(conn, 200, "ok :)") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment