I have defined a plug
in my App.Endpoint
module in the following way:
plug(
Plug.Static,
at: "/",
from: :main_web,
gzip: false,
only: ~w(css fonts images webfonts favicon.ico robots.txt sw.js manifest.json js/app.js),
headers: %{"Access-Control-Allow-Origin" => "*"}
)
Everything works as expected except that this plug is not applied for /js/app.js
I am currently not able to serve just /js/app.js
, but instead am only able to specify js
which will serve all the files in the /js
directory.
How can I specify just this js/app.js
file and not others?
I have tried
only: ~w(... app.js)
only_matching: ~w(... js/app.js)
But I always receive 404 for /js/app.js