anchor.diff:  %%%-------------------------------------------------------------------
   %%% File    : rest_server.erl
   %%% Author  : Ari Lerner
  -%%% Description : 
  +%%% Description :
   %%%
   %%% Created :  Fri Jun 26 17:14:22 PDT 2009
   %%%-------------------------------------------------------------------
  
positive.code: generalize_request_path(Path) ->
    case string:rstr(Path, ".json") of
      0 -> Path;
      _ -> 
        % EWWWW
        string:substr(Path, 1, erlang:length(Path) - 5)
    end.
  
negative.code: decode_data_from_request(Req, _Meth) -> atomize_keys(Req:post_params()).
  
  not_found_web(Resp, Docroot, _Redirect) -> serve_file("not_found.html", Resp:status_code(404), Docroot, false).
  serve_file(Path, Resp, Docroot, Redirect) ->
    RealPath = filename:join([Path]),
    FullPath = filename:join([Docroot, RealPath]),
    case filelib:is_file(FullPath) of
      true ->
        Resp1 = Resp:status_code(200),
        Resp1:file([[], Path]); % this is dumb... thanks simple_bridge
      _ ->
        case Redirect of
          true -> not_found_web(Resp, Docroot, false);
          _ -> ?ERROR_HTML(io_lib:format("Error with serving the page: ~p", [FullPath]))
  