Skip to content

Instantly share code, notes, and snippets.

@willrax
Created February 9, 2016 09:27
Show Gist options
  • Save willrax/6c054355583370a99de2 to your computer and use it in GitHub Desktop.
Save willrax/6c054355583370a99de2 to your computer and use it in GitHub Desktop.
defmodule Plugger.Router do
use Plug.Router
plug Plugger.Authenticate, [token: “token”]
plug :match
plug :dispatch
def start_link do
Plug.Adapters.Cowboy.http(Plugger.Router, [])
end
get "/" do
conn
|> send_resp(200, “You’re in.”)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment