Move static FE routing into its own plug.
[akkoma] / lib / pleroma / plugs / static_fe_plug.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Plugs.StaticFEPlug do
6 def init(options), do: options
7
8 def call(conn, _) do
9 case Pleroma.Config.get([:instance, :static_fe], false) do
10 true -> Pleroma.Web.StaticFE.StaticFEController.call(conn, :show)
11 _ -> conn
12 end
13 end
14 end