Reputation: 1
I am trying to create a Viewer with AutodeskPlattformService using the code on GitHub, and when I set the "client ID", "client secret" and "bucket name" on the aps-simple-viewer-nodejs folder and run "npm start", it says "Missing some of the environment variables. When I set the "client ID", "client secret" and "bucket name" on the nodejs-simple-viewer-nodejs folder and run "npm start", I get the message "Missing some of the environment variables.
Upvotes: 0
Views: 737
Reputation: 1
First Install dotenv : npm i dotenv
Then in config.js file add at the first line : require('dotenv').config()
Create .env file in the root folder and add your variables : APS_CLIENT_ID=XXXXXXXXXXXXXXXXXXXXXX APS_CLIENT_SECRET=XXXXXXXXXXXXX
Upvotes: 0
Reputation: 71
{ "version": "0.2.0", "configurations": [ { "type": "pwa-node", "request": "launch", "name": "Launch Program", "skipFiles": ["<node_internals>/**"], "program": "${workspaceFolder}\\start.js", "envFile": "${workspaceFolder}/.env" } ] }
APS_CLIENT_ID= your client id APS_CLIENT_SECRET= your client secret APS_CALLBACK_URL= http://localhost:3000/api/forge/callback/oauth
Upvotes: 0
Reputation: 71
make a launch.json file under .vscode folder
{
"version": "0.2.0", "configurations": [
{
"type": "pwa-node",
"request": "launch",
"name": "Launch Program",
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}\\start.js",
"env": {
"APS_CLIENT_ID": "",
"APS_CLIENT_SECRET": "",
// "GoogleAPIkey": "",
"APS_CALLBACK_URL": "http://localhost:3000/api/forge/callback/oauth"
/* "redirect_uri": "http://localhost:3000/api/forge/callback/oauth" */
}
} ] }
Upvotes: 0