This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule TrotSample.Router do | |
use Trot.Router | |
get "/", do: 200 | |
get "/hello" do | |
"Hello Trot!!" | |
end | |
import_routes Trot.NotFound |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{"calliope": {:hex, :calliope, "0.3.0"}, | |
"cowboy": {:hex, :cowboy, "1.0.0"}, | |
"cowlib": {:hex, :cowlib, "1.0.1"}, | |
"plug": {:hex, :plug, "0.12.1"}, | |
"plug_heartbeat": {:hex, :plug_heartbeat, "0.1.0"}, | |
"poison": {:hex, :poison, "1.4.0"}, | |
"ranch": {:hex, :ranch, "1.0.0"}, | |
"trot": {:git, "git://github.com/hexedpackets/trot.git", "6d4ddebfa714cc6b4b0b17f43002b3da9c68d6a2", []}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%html | |
%head | |
%title Haml Template | |
%body | |
%h1 Haml Template | |
%p <%= @message %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%html | |
%head | |
%title Haml Template | |
%body | |
%h1 Haml Template | |
%p <%= @message %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%html | |
%head | |
%title Haml Template | |
%body | |
%h1 Haml Template | |
%p <%= @message %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>EEx Template</title> | |
</head> | |
<body> | |
<h1>EEx Template</h1> | |
<p><%= @message %></p> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule TrotSample.Router do | |
use Trot.Router | |
use Trot.Template | |
get "/", do: 200 | |
get "/hello" do | |
"Hello Trot!!" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defp deps do | |
[ { :safetybox, "~> 0.1" } ] | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule SafetyboxSample do | |
def encrypt(password) do | |
Safetybox.encrypt(password) | |
end | |
def authentication(_userid, _user_name, password) do | |
encrypt_password = "" # DBからユーザデータを取得する処理が入る | |
Safetybox.is_decrypted(password, encrypt_password) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule EctoModelsSample.User do | |
use EctoModelsSample.Web, :model | |
use Ecto.Model.Callbacks | |
before_insert :set_password_digest | |
schema "users" do | |
field :name, :string | |
field :email, :string | |
field :password_digest, :string |