Skip to content

Instantly share code, notes, and snippets.

@djKianoosh
Last active January 6, 2016 13:25
Show Gist options
  • Save djKianoosh/82c15b790ddb54cadc28 to your computer and use it in GitHub Desktop.
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
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
@djKianoosh
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment