Autodesk-Forge / viewer-react-express-headless

Headless viewer: Creates a custom Viewer GUI using react-express
https://viewer-rocks.autodesk.io/
MIT License
103 stars 48 forks source link

local setup incorrectly #13

Open johnfelipe opened 7 years ago

johnfelipe commented 7 years ago

This is my steps:

git clone https://github.com/Autodesk-Forge/viewer-react-express-headless.git
cd viewer-react-express-headless/
cd server
cp credentials_.js credentials.js

sudo nano /home/felipe/viewer-react-express-headless/server/credentials.js

##

        client_id: process.env.FORGE_CLIENT_ID || 'ccccc',
        client_secret: process.env.FORGE_CLIENT_SECRET || 'xxxxxxx',
##
cd ..
npm install

sudo nano /home/felipe/viewer-react-express-headless/server/server.js

##
app.set('port', (process.env.PORT || 3002));
##

npm run watch

show me this

Something is already running on port 3000.

Would you like to run the app on another port instead? [Y/n]

I put Y

Starting the development server...

Compiled successfully!

The app is running at:

http://localhost:3003/

Note that the development build is not optimized. To create a production build, use npm run build.

If i put app.set('port', (process.env.PORT || 3002));

Why run in 3003?

An run 3002 to, but with errors:

pantallazo-0395

In console show me this:

THREE.WebGLRenderer 71
viewer3D.min.js?v=v2.14:2175 GET https://developer.api.autodesk.com/viewingservice/v1/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dmlld2VyLXJvY2tzLXJlYWN0L1JDJTIwQ2FyLmYzZA 401 (Unauthorized)
i.rawGet @ viewer3D.min.js?v=v2.14:2175
i.getManifest @ viewer3D.min.js?v=v2.14:2184
k @ viewer3D.min.js?v=v2.14:9539
d.load @ viewer3D.min.js?v=v2.14:9543
i @ Viewer-helpers.js:66
(anonymous) @ Viewer-helpers.js:59
XMLHttpRequest.send (async)
b.refreshCookie @ viewer3D.min.js?v=v2.14:18958
b.refreshToken @ viewer3D.min.js?v=v2.14:18971
b.initializeAuth @ viewer3D.min.js?v=v2.14:18982
e @ viewer3D.min.js?v=v2.14:19204
developer.api.autodesk.com/viewingservice/v1/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dmlld2VyLXJvY2tzLXJlYWN0L1JDJTIwQ2FyLmYzZA:1 GET https://developer.api.autodesk.com/viewingservice/v1/dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6dmlld2VyLXJvY2tzLXJlYWN0L1JDJTIwQ2FyLmYzZA 401 (Unauthorized)
Viewer-helpers.js:89 
johnfelipe commented 7 years ago
credentials: {
    // Replace placeholder below by the Consumer Key and Consumer Secret you got from
    // http://developer.autodesk.com/ for the production server
    client_id: process.env.FORGE_CLIENT_ID || 'cccc',
    client_secret: process.env.FORGE_CLIENT_SECRET || 'vvvvv',
    grant_type: 'client_credentials',
    scope: 'viewables:read', // Setup the needed scopes for authorizing your Token
    callbackUrl: process.env.CALLBACK_URL || ''
},

pantallazo-0400

    callbackUrl: process.env.CALLBACK_URL || ''

i can put that void?

jaimerosales commented 7 years ago

I'm updating this sample to use latest version of the viewer. Give me a couple of minutes ok.

jaimerosales commented 7 years ago

updated to version 3.2, check that you are passing in the correct URN's to the viewer.