aboutsummaryrefslogtreecommitdiffstats
path: root/examples/web_server/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/web_server/src')
-rw-r--r--examples/web_server/src/directory_handler.erl10
1 files changed, 3 insertions, 7 deletions
diff --git a/examples/web_server/src/directory_handler.erl b/examples/web_server/src/directory_handler.erl
index ed342b5..5863bfa 100644
--- a/examples/web_server/src/directory_handler.erl
+++ b/examples/web_server/src/directory_handler.erl
@@ -4,8 +4,7 @@
-module(directory_handler).
%% REST Callbacks
--export([init/3]).
--export([rest_init/2]).
+-export([init/2]).
-export([allowed_methods/2]).
-export([resource_exists/2]).
-export([content_types_provided/2]).
@@ -14,11 +13,8 @@
-export([list_json/2]).
-export([list_html/2]).
-init(_Transport, _Req, _Paths) ->
- {upgrade, protocol, cowboy_rest}.
-
-rest_init(Req, Paths) ->
- {ok, Req, Paths}.
+init(Req, Paths) ->
+ {rest, Req, Paths}.
allowed_methods(Req, State) ->
{[<<"GET">>], Req, State}.