links-lang / links

Links: Linking Theory to Practice for the Web
http://www.links-lang.org
Other
333 stars 43 forks source link

Something wrong with static file serving and/or paths, possibly MacOS dependent #1200

Open jamescheney opened 2 months ago

jamescheney commented 2 months ago

This is on Mac OSx, experienced by a student trying to do a project using Links and replicated by me.

After installing OPAM, OCaml and Links, we can run Links using the linx alias. However, trying to run the non-DB examples using this command line:

linx --path=$OPAM_SWITCH_PREFIX/share/links/examples:$OPAM_SWITCH_PREFIX/share/links/examples/games $OPAM_SWITCH_PREFIX/share/links/examples/webserver/examples-nodb.links

encounters a problem: fetching the CSS file examples/css/doc.css fails with a 404, so the page doesn't display or (for the most part) work properly.

I replicated this in my own Mac OS environment and found through trial and error that the command line DOES work IF run in current working directory from which examples/css/doc.css can be reached as a relative path. I confirmed that that is the file being read, by renaming it temporarily and confirming the 404.

So, it appears in these environments that something relating to the path and webserver static file serving is not working correctly and/or OS dependent (I'll try a clean Linux setup next to see if the same thing happens, but I would be surprised if it does since others would have tripped over it by now). There's an obvious workaround using symbolic links, but it would be nice to make this more portable.