Skip to content

Commit

Permalink
Merge pull request #34 from basho/RTK-default_dispatch_list
Browse files Browse the repository at this point in the history
Set a default dispatch_list.
  • Loading branch information
rustyio committed Aug 4, 2011
2 parents 58847a1 + d6cc4f5 commit 9b1b462
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/webmachine_router.erl
Expand Up @@ -139,8 +139,12 @@ filter_by_resource({_, _, _}, _Resource) ->
true.

get_dispatch_list() ->
{ok, Dispatch} = application:get_env(webmachine, dispatch_list),
Dispatch.
case application:get_env(webmachine, dispatch_list) of
{ok, Dispatch} ->
Dispatch;
undefined ->
[]
end.

set_dispatch_list(DispatchList) ->
ok = application:set_env(webmachine, dispatch_list, DispatchList),
Expand Down

0 comments on commit 9b1b462

Please sign in to comment.