Tuesday 7 April 2020

Three.js : - Running Local Server via Python

Three.js : - Running Local Server via Python 


Three.js is a JavaScript library and application programming interface that can be used to display 3D models and interactive 3D content and games for the web. 
More info here: https://threejs.org/ 

When developing content for webpages, and testing locally browsers need to have a local webhost to display media content like 3d models, and 

One way to do this is by setting up a local web server with Python. 

Here are the steps: 

1. Install Python (3.x)

2. Open Windows Command prompt (CMD) and go to folder where webpage to be run is located: e.g. : C:\WebsiteLocation\

3. Type into CMD:  python -m http.server

4. To run: - Open Browser
                - Type:  http://localhost:8000/ 


Another way to preview locally hosted content is to use the free IDE Brackets, from Adobe. Here is the link: http://brackets.io/