Please refer to https://www.keanw.com/2014/07/my-first-autodesk-360-viewer-sample.html for the backroud story fo this sample.
Live demo at: https://autode.sk/m3w
This sample is dependent on the server part on Node.js and couple of Node.js extensions which would update/install automatically via 'npm':
-
Node.js
Node.js - built on Chrome's JavaScript runtime for easily building fast, scalable network applications. You need at least version v5.11.1. You can get Node.js from here
Node.js modules:"express": "^4.13.4", "morgan": "^1.7.0", "request": "^2.72.0"
The sample was created using Node.js and javascript. There is 3 methods to deploy/configure this project:
Once the Heroku server is setup, go on your Heroku Dashboard, select this new server, next Settings, and press the 'Reveal Config Vars.' button.
Create 3 variables like this:
a. PORT = 80
b. CONSUMERKEY = <your consumer key>
c. CONSUMERSECRET = <your consumer secret>
Next restart the server.
-
Clone this repo on your server (or local machine),
-
Go in your project directory and execute
npm install
Define a CONSUMERKEY and CONSUMERSECRET system variables from the console or script which will launch the server.
- Windows
set CONSUMERKEY=xxx set CONSUMERSECRET=xxx
- OSX/Linux
export CONSUMERKEY xxx export CONSUMERSECRET xxx
or passing on the command line to the Node.js process
sudo [PORT=<port>] CONSUMERKEY=xxx CONSUMERSECRET=xxx node start.js
Replace keys placeholder xxx with your own keys. - Windows
-
You are done for the setup, launch the node server using the command '[sudo] node start.js'. sudo is required only on OSX and Linux.
- Windows
[set PORT=<port>] node start.js
- OSX/Linux
sudo [PORT=<port>] node server.js
Note: the port argument can be omitted and default to port 5000. If port 80 is already in use by another application (like Skype, or IIS, or Apache, ...), you can use any other free port such as 8000, 3000, etc... But in the next section you would need to specify the port to use, i.e. http://localhost[:port]/ - Windows
3. Deploy on your server modifying the source code (make sure the files never go public to not compromise your keys)
-
Clone this repo on your server (or local machine),
-
Go in your project directory and edit the api.js file. Put your CONSUMERKEY and CONSUMERSECRET keys onto the placeholders line #19 and #20.
-
You are done for the setup, launch the node server using the command '[sudo] node server.js'. sudo is required only on OSX and Linux.
- Windows
[set PORT=<port>] node server.js
- OSX/Linux
sudo [PORT=<port>] node server.js
Note: the port argument can be omitted and default to port 5000. If port 80 is already in use by another application (like Skype, or IIS, or Apache, ...), you can use any other free port such as 8000, 3000, etc... But in the next section you would need to specify the port to use, i.e. http://localhost[:port]/ - Windows
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Kean Walmsley (Autodesk)
http://through-the-interface.typepad.com/through_the_interface/