An alternative implementation of learnforge.autodesk.io's Node.js sample code, focusing on a couple of things:
- using fewer dependencies, removing unused dependencies
- using ES6 features such as
let
/const
, fat arrow functions, destructuring, and promises - using
async
/await
The code currently focuses on the server-side, so the front-end is very rudimentary.
- get your Forge credentials: tutorial
- clone the git repo
- install dependencies:
npm install
- run the server
- using Visual Studio Code:
- add the following launch configuration
{ "type": "node", "request": "launch", "name": "Launch Program", "program": "${workspaceFolder}/start.js", "env": { "DEBUG": "express:*", "FORGE_CLIENT_ID": "<your-client-id>", "FORGE_CLIENT_SECRET": "<your-client-secret>" } }
- run the server via Debug > Start Debugging
- using command line
FORGE_CLIENT_ID=<your-client-id> FORGE_CLIENT_SECRET=<your-client-secret> npm run start
- using Visual Studio Code:
- go to localhost:3000