Skip to content

Instantly share code, notes, and snippets.

@darui00kara
Created June 15, 2015 02:10
Show Gist options
  • Save darui00kara/9e7e5ba086b2e15d6344 to your computer and use it in GitHub Desktop.
Save darui00kara/9e7e5ba086b2e15d6344 to your computer and use it in GitHub Desktop.
defmodule TrotSample.Router do
use Trot.Router
use Trot.Template
get "/", do: 200
get "/hello" do
"Hello Trot!!"
end
get "/hello/haml" do
render_template("template.html.haml", [message: "Hello Haml"])
end
get "/hello/eex" do
render_template("template.html.eex", [message: "Hello EEx"])
end
import_routes Trot.NotFound
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment