Put js build through phoenix

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-10-10 14:57:35 +02:00
parent 8d5f4d7a53
commit 3b48ac957f
18 changed files with 1637 additions and 1539 deletions

View File

@@ -11,9 +11,16 @@ defmodule EventosWeb.ActivityPubController do
def actor(conn, %{"name" => name}) do
with %Actor{} = actor <- Actors.get_local_actor_by_name(name) do
conn
|> put_resp_header("content-type", "application/activity+json")
|> json(ActorView.render("actor.json", %{actor: actor}))
case get_req_header(conn, "accept") do
["application/activity+json"] ->
conn
|> put_resp_header("content-type", "application/activity+json")
|> json(ActorView.render("actor.json", %{actor: actor}))
_ ->
conn
|> put_resp_content_type("text/html")
|> send_file(200, "priv/static/index.html")
end
else
nil -> {:error, :not_found}
end