Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 3f62973bbc
Fetching contributors…

Cannot retrieve contributors at this time

26 lines (19 sloc) 0.734 kb
-module(hello_http).
-include("webapp.hrl").
-export([start/1, request/3]).
%%--------------------------------------------------------------------
%% @doc Starts the hello world server.
%% @spec start(Port) -> {ok, Pid}
%% @end
%%--------------------------------------------------------------------
start(Port) ->
modlib:start([{port, Port}, {modules, [?MODULE]}]).
%%--------------------------------------------------------------------
%% @doc Handles a webapp request.
%% @spec request(Method, Path, Info) -> Resp
%% @end
%%--------------------------------------------------------------------
request("GET", _Path, _Info) ->
{ok, {html, "Hello modlib!"}};
request(_Method, _Path, _Info) ->
{error, "Bad Request"}.
Jump to Line
Something went wrong with that request. Please try again.