0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00
cowboy/examples/ssl_hello_world/src/toppage_handler.erl

17 lines
343 B
Erlang
Raw Normal View History

2013-02-27 23:55:05 -06:00
%% Feel free to use, reuse and abuse the code in this file.
%% @doc Hello world handler.
-module(toppage_handler).
-export([init/2]).
2013-02-27 23:55:05 -06:00
-export([handle/2]).
init(Req, Opts) ->
{http, Req, Opts}.
2013-02-27 23:55:05 -06:00
handle(Req, State) ->
Req2 = cowboy_req:reply(200, [
{<<"content-type">>, <<"text/plain">>}
], <<"Hello world!">>, Req),
2013-02-27 23:55:05 -06:00
{ok, Req2, State}.