You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
analytics/lib/plausible_web/controllers/api/internal_controller.ex

18 lines
367 B
Elixir

defmodule PlausibleWeb.Api.InternalController do
use PlausibleWeb, :controller
use Plausible.Repo
def domain_status(conn, %{"domain" => domain}) do
has_pageviews = Repo.exists?(
from e in Plausible.Event,
where: e.domain == ^domain
)
if has_pageviews do
json(conn, "READY")
else
json(conn, "WAITING")
end
end
end