Created
May 6, 2016 16:18
-
-
Save jlouis/e2e05747fba248fd309a81f6007bcaa8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(z_app). | |
-behaviour(application) | |
-export([start/2, prep_stop/1]). | |
start(_StartType, _StartArgs) -> | |
{ok, Pid} = z_sup:start_link(), | |
Dispatch = …, | |
cowboy:start_http(z_app_listener, 100, | |
[{port, 8080}], | |
[{middlewares, [ | |
cowboy_router, | |
cowboy_cors, | |
cowboy_handler | |
]}, | |
{env, [ | |
{cors_policy, z_policy}, | |
{dispatch, Dispatch}]}]), | |
{ok, Pid}. | |
prep_stop(_State) -> | |
cowboy:stop_listener(z_app_listener), | |
ok. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment