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 ExternalAPIRouter do | |
use Phoenix.Router | |
import Plug.Conn | |
import Phoenix.Controller | |
scope "/api/v1" do | |
get("me2", __MODULE__, :me) | |
get("product/:product_id", __MODULE__, :product_detail) | |
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 ExternalUser do | |
use Ecto.Schema | |
import Ecto.Changeset | |
@primary_key false | |
embedded_schema do | |
field(:first_name, :string) | |
field(:last_name, :string) | |
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 Error do | |
defstruct code: nil, message: nil, details: nil | |
@doc """ | |
Creates a new error struct | |
## Usage: | |
iex> Error.new("E001", "This is an error") |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer