Add swaggerUI options (#66)
[akkoma] / lib / pleroma / web / endpoint.ex
index 196d0006b12da73d268e956c5b574df297e418e5..4a235fdd7f66583ed9e212c2a15ee7094da9cce0 100644 (file)
@@ -10,8 +10,7 @@ defmodule Pleroma.Web.Endpoint do
   alias Pleroma.Config
 
   socket("/socket", Pleroma.Web.UserSocket)
-
-  plug(Plug.Telemetry, event_prefix: [:phoenix, :endpoint])
+  socket("/live", Phoenix.LiveView.Socket)
 
   plug(Pleroma.Web.Plugs.SetLocalePlug)
   plug(CORSPlug)
@@ -67,18 +66,28 @@ defmodule Pleroma.Web.Endpoint do
     }
   )
 
-  plug(Plug.Static.IndexHtml, at: "/pleroma/fedife/")
+  plug(Plug.Static.IndexHtml, at: "/akkoma/swaggerui")
 
   plug(Pleroma.Web.Plugs.FrontendStatic,
-    at: "/pleroma/fedife",
-    frontend_type: :fedife,
+    at: "/akkoma/swaggerui",
+    frontend_type: :swagger,
     gzip: true,
+    if: &Akkoma.Web.Swagger.ui_enabled?/0,
     cache_control_for_etags: @static_cache_control,
     headers: %{
       "cache-control" => @static_cache_control
     }
   )
 
+  plug(Pleroma.Web.Plugs.FrontendStatic,
+    at: "/",
+    frontend_type: :mastodon,
+    gzip: true,
+    cache_control_for_etags: @static_cache_control,
+    headers: %{
+      "cache-control" => @static_cache_control
+    }
+  )
 
   # Serve at "/" the static files from "priv/static" directory.
   #