17 lines
311 B
Elixir
17 lines
311 B
Elixir
defmodule Elstat.API.Status do
|
|
require Logger
|
|
|
|
def init(req0, state) do
|
|
data = Elstat.Manager.get_current_state()
|
|
|
|
Logger.debug "#{inspect data}"
|
|
|
|
req = :cowboy_req.reply(200,
|
|
%{"content-type" => "text/json"},
|
|
Poison.encode!(data),
|
|
req0
|
|
)
|
|
|
|
{:ok, req, state}
|
|
end
|
|
end
|