Put js build through phoenix
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -7,6 +7,8 @@ defmodule EventosWeb.PageController do
|
||||
plug(:put_layout, false)
|
||||
|
||||
def index(conn, _params) do
|
||||
render(conn, "index.html")
|
||||
conn
|
||||
|> put_resp_content_type("text/html")
|
||||
|> send_file(200, "priv/static/index.html")
|
||||
end
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ defmodule EventosWeb.Router do
|
||||
end
|
||||
|
||||
pipeline :activity_pub do
|
||||
plug(:accepts, ["activity-json"])
|
||||
plug(:accepts, ["activity-json", "text/html"])
|
||||
plug(EventosWeb.HTTPSignaturePlug)
|
||||
end
|
||||
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
<!DOCTYPE html><html><head><link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons" rel=stylesheet><script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBF37pw38j0giICt73TCAPNogc07Upe_Q4&libraries=places"></script><meta charset=utf-8><title>libre-event</title><link href=/css/app.a3c38b40a31fa078b9acdba649983cb5.css rel=stylesheet></head><body><noscript>Mets du JS.</noscript><div id=app></div><script type=text/javascript src=/js/manifest.881ff1dba0c9e5d0130f.js></script><script type=text/javascript src=/js/vendor.0d63a19c6680451dd336.js></script><script type=text/javascript src=/js/app.29c4f33994925affb616.js></script></body></html>
|
||||
Reference in New Issue
Block a user