fix: build pictures at correct location and fix Plug.Static

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2023-11-15 18:15:21 +01:00
parent f24866012b
commit 3c288c5858
3 changed files with 16 additions and 17 deletions

View File

@@ -10,6 +10,21 @@ defmodule Mobilizon.Web.Endpoint do
use Phoenix.Endpoint, otp_app: :mobilizon
use Absinthe.Phoenix.Endpoint
# Serve at "/" the static files from "priv/static" directory.
#
# You should set gzip to true if you are running phoenix.digest
# when deploying your static files in production.
plug(
Plug.Static,
at: "/",
from: {:mobilizon, "priv/static"},
gzip: false,
only: Mobilizon.Web.static_paths()
# only_matching: ["precache-manifest"]
)
plug(Mobilizon.Web.Plugs.UploadedMedia)
plug(Mobilizon.Web.Plugs.DetectLocalePlug)
if Application.compile_env(:mobilizon, :env) !== :dev do
@@ -37,21 +52,6 @@ defmodule Mobilizon.Web.Endpoint do
do: RemoteIp
)
plug(Mobilizon.Web.Plugs.UploadedMedia)
# Serve at "/" the static files from "priv/static" directory.
#
# You should set gzip to true if you are running phoenix.digest
# when deploying your static files in production.
plug(
Plug.Static,
at: "/",
from: {:mobilizon, "priv/static"},
gzip: false,
only: Mobilizon.Web.static_paths(),
only_matching: ["precache-manifest"]
)
# Code reloading can be explicitly enabled under the
# :code_reloader configuration of your endpoint.
if code_reloading? do