Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (14 sloc) 454 Bytes
defmodule McdWeb.VigiloController do
use McdWeb, :controller
def index(conn, _params) do
{devs, time} = GenServer.call(:attendant, :status)
render(conn, "index.html", devices: devs, time: time)
end
def update(conn, %{"_json" => devices}) do
GenServer.cast(:attendant, {:update, devices})
render(conn, "update.json", status: "success")
end
def update(conn, _) do
render(conn, "update.json", status: "failure")
end
end
You can’t perform that action at this time.