Selecting layouts

Go into lib/app_name_web/endpoint.ex and look for

  plug Plug.Static,
    at: "/", from: :jslib, gzip: false,
    only: ~w(css fonts images js favicon.ico robots.txt)

and add the new folder a to the others

  plug Plug.Static,
    at: "/", from: :jslib, gzip: false,
    only: ~w(a css fonts images js favicon.ico robots.txt)

https://til.hashrocket.com/posts/1a3639476e-serve-static-filesdirectories-in-phoenix

3 Likes