Skip to content

Commit

Permalink
untabify
Browse files Browse the repository at this point in the history
  • Loading branch information
oribrost committed Mar 1, 2011
1 parent 6ee250f commit a27d67b
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/mochieb/src/mochieb_web.erl
Expand Up @@ -21,11 +21,11 @@ stop() ->
mochiweb_http:stop(?MODULE).

http_status(ok) ->
204;
204;
http_status({ok,_}) ->
204;
204;
http_status(_) ->
500.
500.

req_handle('GET', ["balance", Name], Req) ->
case eb:balance(Name) of
Expand All @@ -38,21 +38,21 @@ req_handle('GET', ["balance", Name], Req) ->
req_handle('GET', _, Req) ->
Req:not_found();
req_handle('PUT', ["account", Name], Req) ->
Status = http_status(eb:create_account(Name)),
Req:respond({Status, [], []});
Status = http_status(eb:create_account(Name)),
Req:respond({Status, [], []});
req_handle('PUT', _, Req) ->
Req:not_found();
req_handle('POST', ["deposit", Name, Amount], Req) ->
Status = http_status(eb:deposit(Name, list_to_integer(Amount))),
Req:respond({Status, [], []});
Status = http_status(eb:deposit(Name, list_to_integer(Amount))),
Req:respond({Status, [], []});
req_handle('POST', ["withdraw", Name, Amount], Req) ->
Status = http_status(eb:withdraw(Name, list_to_integer(Amount))),
Req:respond({Status, [], []});
Status = http_status(eb:withdraw(Name, list_to_integer(Amount))),
Req:respond({Status, [], []});
req_handle('POST', _, Req) ->
Req:not_found();
req_handle('DELETE', ["account", Name], Req) ->
Status = http_status(eb:delete_account(Name)),
Req:respond({Status, [], []});
Status = http_status(eb:delete_account(Name)),
Req:respond({Status, [], []});
req_handle('DELETE', _, Req) ->
Req:not_found();
req_handle(_,_,Req) ->
Expand Down

0 comments on commit a27d67b

Please sign in to comment.