Skip to content

Instantly share code, notes, and snippets.

@prio101
Created August 31, 2018 18:46
Show Gist options
  • Save prio101/1f9d3bf3bf81dbfafd190fa816bab822 to your computer and use it in GitHub Desktop.
Save prio101/1f9d3bf3bf81dbfafd190fa816bab822 to your computer and use it in GitHub Desktop.
defmodule Router.SitesRouter do
import Plug.Conn
use Plug.Router
plug :match
plug :dispatch
get "/" do
page = EEx.eval_file("views/sites/index.html.eex")
conn
|> put_resp_content_type("text/html")
|> send_resp(200, page)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment