[erlang-questions] cowboy options via application config
Joel Reymont
joelr1@REDACTED
Thu Dec 1 16:07:23 CET 2011
Is there a way to pass options to cowboy listeners via the application's config file, e.g. rebar's sys.config?
In the code below, I'd rather have the transport, port, key file and password in a config file.
Thanks, Joel
---
cowboy:start_listener(http, 100,
cowboy_tcp_transport, [{port, 8080}],
cowboy_http_protocol, [{dispatch, Dispatch}]
),
cowboy:start_listener(https, 100,
cowboy_ssl_transport, [
{port, 8443}, {certfile, "priv/ssl/cert.pem"},
{keyfile, "priv/ssl/key.pem"}, {password, "cowboy"}],
cowboy_http_protocol, [{dispatch, Dispatch}]
),
--------------------------------------------------------------------------
- for hire: mac osx device driver ninja, kernel extensions and usb drivers
---------------------+------------+---------------------------------------
http://wagerlabs.com | @wagerlabs | http://www.linkedin.com/in/joelreymont
---------------------+------------+---------------------------------------
More information about the erlang-questions
mailing list