Skip to content

rwdaigle/exgen-plug-simple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

exgen-plug-simple

A simple Plug-based web app in Elixir.

Exgen

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 MyApp

Running

Once the app has been generated w/ Exgen, install its dependencies:

$ mix deps.get

Then 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!

Extending

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

About

Exgen template for a simple Plug web app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages