Closed leondavi closed 6 months ago
Hi @leondavi ,
There is nothing particularly special about the location of simple_bridge.config
. In your app, you can simply put the configuration options in your app.config
and when simple_bridge
loads, it'll bring in the configuration from your app.config
.
Alternatively, you can load the application, then use things like application:set_env/[1-4]
to set the configuration terms for custom configuration.
Hi @leondavi ,
There is nothing particularly special about the location of
simple_bridge.config
. In your app, you can simply put the configuration options in yourapp.config
and whensimple_bridge
loads, it'll bring in the configuration from yourapp.config
.Alternatively, you can load the application, then use things like
application:set_env/[1-4]
to set the configuration terms for custom configuration.
Thanks!
Of course! I hope that helps. I'm also open, if you're feeling spicy and wanting to add some functionality, I'm open to merging a pull request that adds another clause to simple_bridge:start/1
for simple_bridge:start(Config)
where Config
can be either any of the following:
1) A string to represent the location of a config file to load,
2) A map
or proplist
of the terms of the simple_bridge
configuration (e.g. [{port, 8000}, {address, "0.0.0.0"}, ...])
3) A 2-tuple of {Module, Function}
that could then call Module:Function()
which would return the same kind of values as represented in (2).
That is, if you're feeling up to it :)
I would want to load the configuration file and start simple_bridge server from another supervisor module. Is there an option to set a path to the configuration file on run-time?