-module(helloworld). -export([init/1, routes/0]). -behaviour(http_handler). -include("./include/brunhilde.hrl"). %% Called upon the start of the server, server %% can do whatever it wishes do to here. -spec init(atom()) -> atom(). init(InstanceName) -> ?liof("I have been initialized, I am ~p~n", [InstanceName]), ok. routes() -> [#route{protocol = html, verb = get, address = <<"/helloworld.html">>, callback = fun handle_html/4}, #route{protocol = html, verb = post, address = <<"/handle_post">>, callback = fun handle_post/4}, {'*', fun handle_wildcard/4} ]. handle_html(_Data, _Parameters, _Headers, _InstanceName) -> Html = "" "
" "