aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers/delay_hello_h.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/handlers/delay_hello_h.erl')
-rw-r--r--test/handlers/delay_hello_h.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/handlers/delay_hello_h.erl b/test/handlers/delay_hello_h.erl
new file mode 100644
index 0000000..7e59be6
--- /dev/null
+++ b/test/handlers/delay_hello_h.erl
@@ -0,0 +1,9 @@
+%% This module sends a hello world response after a delay.
+
+-module(delay_hello_h).
+
+-export([init/2]).
+
+init(Req, Delay) ->
+ timer:sleep(Delay),
+ {ok, cowboy_req:reply(200, #{}, <<"Hello world!">>, Req), Delay}.