Last active
October 22, 2016 16:32
-
-
Save renanvalentin/5334727318875d73d99b2bb971353a27 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 LearningElixir.Router do | |
use Plug.Router | |
plug :match | |
plug :dispatch | |
def start_link do | |
{:ok, _} = Plug.Adapters.Cowboy.http LearningElixir.Router, [], [port: 4001] | |
end | |
get "/" do | |
send_resp(conn, 200, "Hello") | |
end | |
match _ do | |
send_resp(conn, 404, "oops") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment