0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00
cowboy/test/handlers/delay_hello_h.erl

10 lines
213 B
Erlang
Raw Normal View History

%% 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}.