Current section

Files

Jump to
exwechat lib ex_wechat.ex
Raw

lib/ex_wechat.ex

defmodule ExWechat do
@moduledoc """
Elixir Wechat Application
"""
use Application
# -------------------- Application API ---------------------
@doc """
Start API
"""
def start(_type, _args) do
{:ok, sup} = ExWechat.Sup.start_link
{:ok, sup}
end
# -------------------- ExWechat API ---------------------
@doc """
Wechat API Token
"""
def token, do: ExWechat.TokenServ.token()
@doc """
Wechat AppID and AppSecret
"""
def app_id, do: System.get_env("WECHAT_APP_ID") || nil
def app_secret, do: System.get_env("WECHAT_APP_SECRET") || nil
end