From 9167a2ebe30f3835f2e9139443dc60f8f0c44563 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 19 Apr 2017 15:25:18 +0200 Subject: [PATCH] Send frontend through phoenix. --- lib/pleroma/web/endpoint.ex | 3 +++ lib/pleroma/web/router.ex | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/pleroma/web/endpoint.ex b/lib/pleroma/web/endpoint.ex index 6af42a685..45a3a345d 100644 --- a/lib/pleroma/web/endpoint.ex +++ b/lib/pleroma/web/endpoint.ex @@ -9,6 +9,9 @@ defmodule Pleroma.Web.Endpoint do # when deploying your static files in production. plug Plug.Static, at: "/media", from: "uploads", gzip: false + plug Plug.Static, + at: "/", from: :pleroma, + only: ~w(index.html static) # Code reloading can be explicitly enabled under the # :code_reloader configuration of your endpoint. diff --git a/lib/pleroma/web/router.ex b/lib/pleroma/web/router.ex index cc1f0e165..05d497aa8 100644 --- a/lib/pleroma/web/router.ex +++ b/lib/pleroma/web/router.ex @@ -70,4 +70,14 @@ defmodule Pleroma.Web.Router do get "/host-meta", WebFinger.WebFingerController, :host_meta get "/webfinger", WebFinger.WebFingerController, :webfinger end + + scope "/", Fallback do + get "/*path", RedirectController, :redirector + end + +end + +defmodule Fallback.RedirectController do + use Pleroma.Web, :controller + def redirector(conn, _params), do: send_file(conn, 200, "priv/static/index.html") end -- 2.45.2