Skip to content

Commit

Permalink
Fixed paths for Amazon ELB
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDryga committed May 12, 2017
1 parent 5fd06d0 commit ab6a679
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/api/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,27 @@ defmodule API.Router do
get "/:id", Claim, :show
post "/:id/auth", Claim, :authentificate
end

# Fixed paths for Amazon ELB
scope "/gateway/", API.Controllers do
pipe_through :public_api

post "/tokens", Token, :create
end

scope "/gateway/transfers", API.Controllers do
pipe_through :private_api

post "/", Transfer, :create
get "/:id", Transfer, :show
post "/:id/auth", Transfer, :authentificate
end

scope "/gateway/claims", API.Controllers do
pipe_through :private_api

post "/", Claim, :create
get "/:id", Claim, :show
post "/:id/auth", Claim, :authentificate
end
end
13 changes: 13 additions & 0 deletions test/api/acceptance/token_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ defmodule API.Controllers.TokenTest do
} = "tokens"
|> post!(@card)
|> get_body

assert %{
"meta" => %{
"code" => 201
},
"data" => %{
"type" => "card-token",
"token" => @token_prefix <> _,
"token_expires_at" => _
}
} = "/gateway/tokens"
|> post!(@card)
|> get_body
end

test "create invalid card" do
Expand Down

0 comments on commit ab6a679

Please sign in to comment.