elstat/lib/api.ex

16 lines
275 B
Elixir
Raw Normal View History

2018-06-11 20:42:40 +00:00
defmodule Elstat.API.Status do
require Logger
def init(req0, state) do
data = Elstat.Manager.get_current_state()
req = :cowboy_req.reply(200,
%{"content-type" => "text/json"},
Poison.encode!(data),
req0
)
{:ok, req, state}
end
end