Last active
January 6, 2016 13:25
-
-
Save djKianoosh/82c15b790ddb54cadc28 to your computer and use it in GitHub Desktop.
Minimalistic elixir starter... index from priv, all other static from priv/static, and remaining catch all to hello world
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 Hellostaticplug do | |
use Plug.Router | |
plug Plug.Static, at: "/static", from: :hellostaticplug | |
plug :match | |
plug :dispatch | |
get "/" do | |
Plug.Conn.send_file(conn, 200, "priv/index.html") | |
end | |
match _ do | |
send_resp(conn, 404, "Not Found") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for when Phoenix is just too big of a beast and you just wanna do a quick single page app in simple js and elixir on the server