Authorization and file translation demo in Node.js : Translates your 2D/3D models online for the Forge Viewer without programming at all
Autodesk Platform Services API:
Note: For hosting this sample, you do not need any credentials. But anyone using the sample will need
valid credentials for the upload /translation process. Visit the Autodesk Platform Services WEB site for
instructions to get on-board.
This sample exercises and demonstrates the Autodesk Platform Services API authorization, and translation process
mentioned in the Quick Start guide. It provides you a quick way to get file ready for viewing on your own account
without programming.
This sample is dependent of Node.js and few Node.js extensions which would update/install automatically via ‘npm’.
This sample is also dependent on the client side on couple of javascript library which are installed
along this sample:
filedrop.js - A Self-contained cross-browser HTML5, legacy, AJAX, drag & drop JavaScript file upload, available here.
flipclock.js - A flip clock javascript library, available here.
zeroclipboard.js - A library which provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface,
available here.
The sample was created using Node.js and javascript.
Download and install Node.js (that will install npm as well)
Download this repo anywhere you want (the server will need to write files, so make sure you install in
a location where you have write permission, at least the ‘uploads’ folder)
Execute ‘npm install’, this command will download and install the required node modules automatically for you.
npm install
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.
[set PORT=<port>]
node start.js
sudo [PORT=<port>] node start.js
Note: the port argument can be omitted and default to port 3000. If port 3000 is already in use by another
application, you can use any other free port. But in the next section you would need to specify the port to
use, i.e. http://localhost[:port]/
Translating files
This sample is licensed under the terms of the MIT License. Please see the LICENSE file for full details.
Cyrille Fauvel
Developer Advocacy
http://aps.autodesk.com/
http://around-the-corner.typepad.com