Hello ,
This is the snippet of the code
defmodule PlugEx.Router do
use Plug.Router
use Plug.Debugger
plug(Plug.Logger, log: :debug)
plug :match
plug :dispatch
plug Plug.Static, at: "/", from: :server, only: ~w(js css images robots.txt)
get "/" do
send_resp(conn, 200, "Hello There!")
end
get "/about/:user_name" do
send_resp(conn, 200, "Hello, #{user_name}")
end
get "/home" do
conn = put_resp_content_type(conn, "text/html")
send_file(conn, 200, "priv/index.html")
end
match _, do: send_resp(conn, 404, "404 error not found!")
end






















