Created
August 31, 2018 18:45
-
-
Save prio101/313e1620ad340f7e1b95d21d390a7ea1 to your computer and use it in GitHub Desktop.
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.MainRouter do | |
use Plug.Router | |
plug :match | |
plug :dispatch | |
get "/" do | |
page = EEx.eval_file("views/index.html.eex") | |
conn | |
|> put_resp_content_type("text/html") | |
|> send_resp(200, page) | |
end | |
forward "/sites", to: Router.SitesRouter | |
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