line_bot/sample/lib/line_bot_sample/application.ex
Adam Millerchip 7915b6d4ed Initial checkin.
I originally developed this as an employee under the assumption that
this would be released as an official SDK maintained by the company. But
this is not the case, so I'm resetting the history to develop this in a
personal capacity. This commit represents the progress until now.
2019-09-02 20:46:29 +09:00

19 lines
487 B
Elixir

defmodule LineBotSample.Application do
use Application
require Logger
@moduledoc false
def start(_type, _args) do
port = Application.get_env(:line_bot_sample, :port) || 4000
children = [
Plug.Cowboy.child_spec(scheme: :http, plug: LineBotSample.Router, options: [port: port])
]
opts = [strategy: :one_for_one, name: LineBotSample.Supervisor]
Logger.info("Starting bot server on port #{port}...")
Supervisor.start_link(children, opts)
end
end