Skip to content

Commit

Permalink
Pass port to start webserver on via app-args
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderWingard committed Nov 8, 2010
1 parent 395048f commit 7e9ad65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 4 additions & 1 deletion site/ebin/umts.app
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@


{application, umts, [
{description, "the Ultimate Magic Trading System"},
{mod, {umts_app, []}}
{applications, [sasl, nprocreg]},
{mod, {umts_app, 8000}}
]}.
8 changes: 3 additions & 5 deletions site/src/umts_app.erl
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
-module (umts_app).
-export ([start/2, stop/0, do/1]).
-include_lib ("nitrogen/include/wf.hrl").
-define(PORT, 8000).


start(_, _) ->
start(_, Port) ->
inets:start(),
umts_db:init(),
{ok, Pid} = inets:start(httpd, [
{port, ?PORT},
{port, Port},
{server_name, "UMTS"},
{server_root, "."},
{document_root, "./static"},
Expand All @@ -19,7 +17,7 @@ start(_, _) ->
{ok, Pid}.

stop() ->
httpd:stop_service({any, ?PORT}),
inets:stop(),
ok.

do(Info) ->
Expand Down

0 comments on commit 7e9ad65

Please sign in to comment.