diff options
Diffstat (limited to 'examples/rest_pastebin/src/toppage_handler.erl')
-rw-r--r-- | examples/rest_pastebin/src/toppage_handler.erl | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/rest_pastebin/src/toppage_handler.erl b/examples/rest_pastebin/src/toppage_handler.erl index 506fc82..89fd786 100644 --- a/examples/rest_pastebin/src/toppage_handler.erl +++ b/examples/rest_pastebin/src/toppage_handler.erl @@ -4,7 +4,7 @@ -module(toppage_handler). %% Standard callbacks. --export([init/3]). +-export([init/2]). -export([allowed_methods/2]). -export([content_types_provided/2]). -export([content_types_accepted/2]). @@ -15,11 +15,9 @@ -export([paste_html/2]). -export([paste_text/2]). -init(_Transport, _Req, []) -> - % For the random number generator: - {X, Y, Z} = now(), - random:seed(X, Y, Z), - {upgrade, protocol, cowboy_rest}. +init(Req, Opts) -> + random:seed(now()), + {rest, Req, Opts}. allowed_methods(Req, State) -> {[<<"GET">>, <<"POST">>], Req, State}. |