Is there a way to pass parameters to the root supervisor of the application other than the configuration file and the application: get_env / 1? For example, on the command line?
I run my application as "erl -pa ebin -run appname" and then communicate with it via TCP / IP. The TCP port on which it is listening is set to ebin / appname.app, to env part. Now I would like to tell my application to forget about it and listen to the port that I would give on the command line (something like "erl -pa ebin -run appname -env [{port, 1234}]"). Is there a standardized template for this?
The problem is that I sometimes decide that the application should start from a different port, and not by default, for testing and changing the .app file every time is just a pain in the ass.
Regards, dijxtra
source share