Sha256: b92d38724bda933dd416317bee598911e46c1cf39e99199ae7c48804272db23e
Contents?: true
Size: 1.07 KB
Versions: 1
Compression:
Stored size: 1.07 KB
Contents
%% @author Ari Lerner <ari.lerner@citrusbyte.com> %% @copyright 2008 Ari Lerner. %% @doc PoolParty panel -module (cloudpanel_web). -author('Ari Lerner <ari.lerner@citrusbyte.com>'). -export([start/1, stop/0, loop/2]). -define(TIMEOUT, 20000). %% External API start(Options) -> {DocRoot, Options1} = get_option(docroot, Options), Loop = fun (Req) -> ?MODULE:loop(Req, DocRoot) end, mochiweb_http:start([{name, ?MODULE}, {loop, Loop} | Options1]). stop() -> mochiweb_http:stop(?MODULE). loop(Req, DocRoot) -> "/" ++ Path = Req:get(path), case Req:get(method) of Method when Method =:= 'GET'; Method =:= 'HEAD' -> case Path of _ -> Req:serve_file(Path, DocRoot) end; 'POST' -> case Path of _ -> Req:not_found() end; _ -> Req:respond({501, [], []}) end. %% Internal API get_option(Option, Options) -> {proplists:get_value(Option, Options), proplists:delete(Option, Options)}.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
auser-poolparty-0.2.39 | lib/erlang/cloudpanel/src/cloudpanel_web.erl |