file-based routing library for elixir
Concerto is available in Hex and can be installed as:
Add concerto your list of dependencies in
mix.exs:def deps do [{:concerto, "~> 0.1.0"}] end
Given the following directory structure
.
├── lib
│ └── my_router.ex
└── web
├── GET.exs
└── users
└── @user
├── GET.exs
└── POST.exsa router can be contstructed with the following:
defmoduleMyRouterdouseConcerto,root: "web",ext: ".exs",methods: ["GET","POST","PUT","DELETE","PATCH"],module_prefix: MyApp.Webend