aboutsummaryrefslogtreecommitdiff
path: root/apps/dreki_web/src/api/dreki_web_task.erl
diff options
context:
space:
mode:
authorJordan Bracco <href@random.sh>2022-04-17 03:25:09 +0000
committerJordan Bracco <href@random.sh>2022-04-17 03:25:09 +0000
commit93d3514676cad95b94bbb3e483d02b7ea0076bba (patch)
tree0f7548c1cd274ec01873b5ebf39b6a39bea4e282 /apps/dreki_web/src/api/dreki_web_task.erl
parentguess it was time for an initial commit (diff)
Diffstat (limited to 'apps/dreki_web/src/api/dreki_web_task.erl')
-rw-r--r--apps/dreki_web/src/api/dreki_web_task.erl21
1 files changed, 21 insertions, 0 deletions
diff --git a/apps/dreki_web/src/api/dreki_web_task.erl b/apps/dreki_web/src/api/dreki_web_task.erl
new file mode 100644
index 0000000..fdcf9cd
--- /dev/null
+++ b/apps/dreki_web/src/api/dreki_web_task.erl
@@ -0,0 +1,21 @@
+-module(dreki_web_task).
+-behaviour(cowboy_handler).
+-behaviour(cowboy_rest).
+-export([init/2]).
+-export([allowed_methods/2]).
+-export([content_types_accepted/2]).
+-export([content_types_provided/2]).
+
+init(Req, State) ->
+ {cowboy_rest, Req, State}.
+
+allowed_methods(Req, State) ->
+ {[<<"GET">>, <<"HEAD">>, <<"OPTIONS">>, <<"POST">>], Req, State}.
+
+content_types_accepted(Req, State) ->
+ dreki_web:content_types_accepted(Req, State).
+
+content_types_provided(Req, State) ->
+ dreki_web:content_types_provided(Req, State).
+
+