Opening HTML5 Project using local host vs local file (macOS)

I use Visual Studio Code on macOS Mojave to build projects to HTML5. The initial build is created using the command “lime: test html5” which opens the project using the url “http://127.0.0.1:3000”. After that I can use “lime: build (current configuration)” to rebuild and just reload in the browser.

I changed my local security settings so that the browsers l use have “Full Disk Access”. But when I open index.html in the browser I get errors that stops the loading.

Why do I get different results?

I believe it is due to CORS (cross origin resource sharing) restrictions which tend to prevent local access from working properly or in tandem with remote resources. It might also be in handling unknown MIME types. Running a real local testing server has seemed to be the only reasonable way to do it.

Another approach would be a LAMP server running on your machine at all times so you can go to http://localhost/path/to/your/project/bin/html5/bin/index.html

You can also use lime test html5 -nolaunch to restart the build and server without opening the browser again

I’m trying to use XAMPP to to access each of my local html5 projects directly without having to do another build. I’ve installed it and have XAMPP running with ProFTPD, Apache & MySQL services running and localhost:8080 -> 80 (Over SSH) enabled. In my browser i tried these with the path Users/…/html5/bin/index.html.

http://localhost:8080/path and got “The requested URL was not found on this server.”

http://localhost/path and got “Can’t Connect to Server”

http://8080/path and got “Can’t open http://0.0.31.144/path because the server suddenly dropped the connection…”

Any ideas?

Thanks in advance!