diff --git a/Procfile b/Procfile new file mode 100644 index 0000000..82866d7 --- /dev/null +++ b/Procfile @@ -0,0 +1 @@ +web: erl -pa deps/*/ebin ebin -noshell -noinput -config priv/config/environments/development -s aloha_app diff --git a/src/aloha_app.erl b/src/aloha_app.erl index c8f8a27..b614212 100644 --- a/src/aloha_app.erl +++ b/src/aloha_app.erl @@ -17,8 +17,18 @@ start(_StartType, _StartArgs) -> ok = application:start(syntax_tools), ok = application:start(lager), reloader:start(), - elli:start_link([{callback, aloha_api}, {port, 3000}]), + DefaultPort = application:get_env(aloha, worker_port), + Port = get_port(DefaultPort), + elli:start_link([{callback, aloha_api}, {port, Port}]), aloha_sup:start_link(). stop(_State) -> ok. + + +get_port(Default) -> + Key = "PORT", + case os:getenv(Key) of + false -> Default; + Val -> list_to_integer(Val) + end.