A simple Plug-based web app in Elixir.
To create a new copy of this app, use Exgen:
$ mix exgen.new new_dir \
-t https://github.com/rwdaigle/exgen-plug-simple.git \
--app-name my_app --module MyAppOnce the app has been generated w/ Exgen, install its dependencies:
$ mix deps.getThen start the app using iex:
$ iex -S mix
iex(1)>Load localhost:4000 in your browser. You will see the basic text-response defined for the root path:
Hello there!
To begin adding your own endpoints, open lib/<%= app_name %>/router.ex and start defining simple paths:
get "/status" do
conn
|> put_resp_content_type("text/html")
|> send_resp(200, "OK")
end