aboutsummaryrefslogtreecommitdiffstats
path: root/templates/cowboy_rest_h.erl
diff options
context:
space:
mode:
Diffstat (limited to 'templates/cowboy_rest_h.erl')
-rw-r--r--templates/cowboy_rest_h.erl14
1 files changed, 14 insertions, 0 deletions
diff --git a/templates/cowboy_rest_h.erl b/templates/cowboy_rest_h.erl
new file mode 100644
index 0000000..a15f4a5
--- /dev/null
+++ b/templates/cowboy_rest_h.erl
@@ -0,0 +1,14 @@
+-module(template_name).
+
+-export([init/3]).
+-export([content_types_provided/2]).
+-export([get_html/2]).
+
+init(_, _Req, _Opts) ->
+ {upgrade, protocol, cowboy_rest}.
+
+content_types_provided(Req, State) ->
+ {[{{<<"text">>, <<"html">>, '*'}, get_html}], Req, State}.
+
+get_html(Req, State) ->
+ {<<"<html><body>This is REST!</body></html>">>, Req, State}.