-
Notifications
You must be signed in to change notification settings - Fork 0
How to run things locally
If you use just procedural geometries and don't load any textures, webpages should work straight from the file system, just double-click on HTML file in a file manager and it should appear working in the browser (accessed as file:///example).
If you load models or textures from external files, due to browsers' "same origin policy" security restrictions, loading from a file system will fail with a security exception.
There are two ways how to solve this:
-
Change security for local files in a browser (access page as
file:///example) -
Run files from a local server (access page as
http://localhost/example)
If you use option 1, be aware that you may open yourself to some vulnerabilities if using the same browser for a regular web surfing. You may want to create a separate browser profile / shortcut used just for local development to be safe.
Start Chrome executable with a command line flag:
chrome --allow-file-access-from-files
On Windows, the easiest is probably to create a special shortcut which has added flag (right-click on shortcut -> properties -> target).
- Go to
about:config - Find
security.fileuri.strict_origin_policyparameter - Set it to
false
The simplest probably is to use Python's built-in http server.
If you have installed Python, it should be enough to run this from a command line:
# Python 2.x
python -m SimpleHTTPServer# Python 3.x
python -m http.serverThis will serve files from the current directory at localhost under port 8000:
Of course, you can use any regular full-fledged web server like Apache or nginx.