[erlang-questions] cowboy options via application config

Bob Ippolito bob@REDACTED
Thu Dec 1 17:03:11 CET 2011


You could just call the appropriate application module functions to get the
data from keys in your app's config.

On Thursday, December 1, 2011, Joel Reymont <joelr1@REDACTED> wrote:
> 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
> ---------------------+------------+---------------------------------------
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111201/367d4f62/attachment.htm>


More information about the erlang-questions mailing list