Now we can start the application from the commandline, and still use supervisors.

This commit is contained in:
Jonatan Pålsson 2011-02-01 16:05:11 +01:00
parent 72e411aee9
commit af75d731b4
7 changed files with 20 additions and 4 deletions

View file

@ -2,12 +2,17 @@
-behaviour(supervisor).
%% API
-export([start_link/1]).
-export([start/1, start_link/1]).
%% Supervisor callbacks
-export([init/1]).
-define(SERVER, ?MODULE).
start(Port) ->
[FirstArg] = Port,
{IntPort, _} = string:to_integer(FirstArg),
start_link(IntPort).
start_link(Port) ->
supervisor:start_link({local, ?SERVER}, ?MODULE, [Port]).