Test webpages locally

In many worksheets, you will need to load a file, either a 3D model or an image file that will serve as a texture. However, the browser refuses to load files stored on your own file system for security reasons. Here are some solutions to still be able to test your solutions locally, feel free to choose the one you feel most comfortable with.

Insecure browser

Your browser may provide an insecure mode that can be activated for testing purposes. In Chrome you can run in insecure mode by closing all running instances of Chrome and running it as follows:

chrome.exe --allow-file-access-from-files

If you do this, it is important that you close Chrome and reopen it without this insecure setting before using it for regular internet browsing.

Local server

Serving all your local files from a server running locally will prevent the issue, as it will work just as if you had uploaded your files to a server such as your DTU homepage. There are a number of ways to easily run a local server from your laptop.

Python

If you have python installed on your laptop, one command line is enough to start a local server:

Your worksheets should now be accessible at: http://localhost:8000/ . Refer to the docs for more details.

Node

If you have node.js installed on your laptop, install http-server:

Go to the folder with your worksheets and run:

Your worksheets should now be accessible at: http://localhost:8080/ . Refer to the docs for more details.

Browser extension

Some browser extensions can run a local server to serve files. It is very easy to install, just follow the instructions on the extension page. On Chrome you can try Web Server for Chrome.