Skip to content

Commit

Permalink
adding support for heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
phuesler committed Oct 9, 2012
1 parent 9f934d8 commit 167adfb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions Procfile
@@ -0,0 +1 @@
web: erl -pa deps/*/ebin ebin -noshell -noinput -config priv/config/environments/development -s aloha_app
12 changes: 11 additions & 1 deletion src/aloha_app.erl
Expand Up @@ -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.

0 comments on commit 167adfb

Please sign in to comment.