Packages

A template for building API clients to 3rd party REST applications. This will generate templates for get, post functions. You then extend the project with convenience functions to access the API like it were just another Elixir lib.

Current section

Files

Jump to
gen_template_api_client template $PROJECT_NAME$ mix.exs
Raw

template/$PROJECT_NAME$/mix.exs

defmodule <%= @project_name_camel_case %>.Mixfile do
use Mix.Project
@name :<%= @project_name %>
@version "0.1.0"
@deps [
{:mix_test_watch, "~> 0.3", only: :dev, runtime: false},
{:poison, "~> 3.1.0"},
{:httpoison, "~> 0.11.1"},
{:ex_doc, ">= 0.0.0", only: :dev},
]
@aliases [
]
# ------------------------------------------------------------
def project do
in_production = Mix.env == :prod
[
app: @name,
version: @version,
elixir: ">= <%= @elixir_version %>",
<%= if @in_umbrella? do %>
build_path: "../../_build",
config_path: "../../config/config.exs",
deps_path: "../../deps",
lockfile: "../../mix.lock",
start_permanent: in_production,
<% else %>
deps: @deps,
aliases: @aliases,
build_embedded: in_production,
<% end %>
]
end
def application do
[
mod: { <%= @project_name_camel_case %>.Application, [] },
extra_applications: [
:logger
],
]
end
end