elm-live src/Main.elm -u -- --output=elm.js
definitely works whatever the number of path segments in your URL if you have an ./index.html
file.
You most likely forgot the slash before elm.js
in <script src="/elm.js"></script>
in your index.html
.
If you use <script src="elm.js"></script>
instead without the slash, it will try to load the javascript file relatively to the current directory, which is ./blog/
when loading localhost:8000/blog/42
, therefore trying to load ./blog/elm.js
. This is the expected behavior with any server.