Skip to content

Commit

Permalink
[#38] Remove unnecessary functions and redefine options type
Browse files Browse the repository at this point in the history
  • Loading branch information
harenson committed Dec 3, 2015
1 parent 7ce1839 commit 800cf45
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/cowboy_swagger_redirect_handler.erl
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
-module(cowboy_swagger_redirect_handler).

%% Cowboy callbacks
-export([ init/3
, rest_init/2
, content_types_provided/2
]).
-export([init/3]).

%% Handlers
-export([resource_exists/2, previously_existed/2, moved_permanently/2]).

-type state() :: #{}.
-type route_match() :: '_' | iodata().
-type options() :: #{server => ranch:ref(), host => route_match()}.
-type options() :: any().

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Cowboy Callbacks
Expand All @@ -23,18 +19,6 @@
init(_Transport, _Req, _Opts) ->
{upgrade, protocol, cowboy_rest}.

%% @hidden
-spec rest_init(cowboy_req:req(), options()) ->
{ok, cowboy_req:req(), options()}.
rest_init(Req, Opts) ->
{ok, Req, Opts}.

%% @hidden
-spec content_types_provided(cowboy_req:req(), state()) ->
{[term()], cowboy_req:req(), state()}.
content_types_provided(Req, State) ->
{[{<<"application/json">>, handle_get}], Req, State}.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Handlers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Expand Down

0 comments on commit 800cf45

Please sign in to comment.