I wont detail why I wont use the javascript ecosystem. I downloaded a js file that I have to host myself because its not always possible to link to external sources.
I’m in development now which was created with brunch included and thats why I have these folders:
/assets/js
and
/priv/static/js
But it is not clear to me where I’d put the file when I run without replying on brunch. I tried to put a copy of the js file on many paths then called in html: <script src="<%= static_path(@conn, "/js/myfile.js") %>"></script>
but it wont work.
# rlp/lib/rlp_web/endpoint.ex
defmodule RlpWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :rlp
socket "/socket", RlpWeb.UserSocket
# 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: :rlp, gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt)
...
Solved it. Many, many thanks guys. I dont know what was wrong, the generated URL for js file was ok in html source , but I remember the logger told me that it could not find the route, only for that file. I started to access in the browser all the files in static until I got it right.