Skip to content

Commit

Permalink
Alter the web interface of the CRE to provide status.json and cache.json
Browse files Browse the repository at this point in the history
  • Loading branch information
joergen7 committed Apr 17, 2018
1 parent 178348e commit 70e12d9
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 434 deletions.
2 changes: 1 addition & 1 deletion src/cre.erl
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ start( _Type, _Args ) ->
Dispatch =
cowboy_router:compile(
[{'_', [
{"/[index.html]", cre_index_handler, []},
{"/[status.json]", cre_status_handler, []},
{"/cache.json", cre_cache_handler, []}
]}] ),

Expand Down
6 changes: 2 additions & 4 deletions src/cre_cache_handler.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@

init( Req0, State ) ->

PairLst = cre_master:cache( cre_master ),
Cache = [#{ request => A, reply => Delta } || {A, Delta} <- PairLst],

Doc = jsone:encode( #{ cache => Cache } ),
CacheMap = cre_master:get_cache( cre_master ),
Doc = jsone:encode( CacheMap ),

Reply =
cowboy_req:reply(
Expand Down
170 changes: 0 additions & 170 deletions src/cre_html.erl

This file was deleted.

170 changes: 0 additions & 170 deletions src/cre_index_handler.erl

This file was deleted.

Loading

0 comments on commit 70e12d9

Please sign in to comment.