delay_hello_h.erl 213 B

123456789
  1. %% This module sends a hello world response after a delay.
  2. -module(delay_hello_h).
  3. -export([init/2]).
  4. init(Req, Delay) ->
  5. timer:sleep(Delay),
  6. {ok, cowboy_req:reply(200, #{}, <<"Hello world!">>, Req), Delay}.