Skip to content

Commit 25e4360

Browse files
committed
Update README.md
1 parent d411913 commit 25e4360

File tree

1 file changed

+41
-25
lines changed

1 file changed

+41
-25
lines changed

README.md

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -39,39 +39,55 @@ With the production server, you got 2 options to setup and run this sample.
3939
```
4040
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/node/basic](http://localhost:3000/node/basic)
4141

42-
Option B: Use your own credentials and upload models on your account
42+
### Option B: Use your own credentials and upload models on your account
4343

44-
* Apply your own credentials from http://developer.autodesk.com
45-
* Install Node.js
46-
* Run "npm install" command from the server directory to install the necessary packages which are mentioned in Dependencies.
47-
* Replace the place holder with your own credentials in credentials.js
44+
* Apply your own credentials from [http://developer.autodesk.com](http://developer.autodesk.com)
45+
* Replace the place holder with your own keys in credentials.js, line #23 and #25 <br />
46+
```
47+
credentials.ClientId = '<replace with clientId>';
48+
credentials.ClientSecret = '<replace with clientSecret>';
49+
```
4850
* Upload one of your model in your account and get its URN using other workflow sample,for example, [this workflow sample in .net winform application](https://github.com/Developer-Autodesk/workflow-dotnet-winform-view.and.data.api/) if you are using windows or [this workflow sample in Mac OS Swift](https://github.com/Developer-Autodesk/workflow-macos-swift-view.and.data.api) if you are using Mac.
49-
* Get your model urn from the workflow sample, and copy this URN in /www/views/index.js, replace the one for "urnprod", around line #20.
50-
* In /www/views/index.js, around line #28, make sure the variable staging is false.
51-
* In /www/views/index.js, around line #31, change value of tokenurl to get token through Node.js server
52-
* In /www/views/index.html, use viewer3D.min.js and style.css from production environment
53-
* Run the server: "node server.js" from command line
54-
* Connect to server locally using a WebGL-compatible browser: http://localhost:3000/node/basic
55-
56-
To work with staging, only option B is available currently.
57-
* Apply your own credentials from http://developer-stg.autodesk.com
58-
* Install Node.js
59-
* Run "npm install" command from the server directory to install the necessary packages which are mentioned in Dependencies..
60-
* Replace the place holder with your own credentials in credentials-stg.js
61-
* Upload one of your model in your account and get its URN using other workflow sample,for example, [this workflow sample in .net winform application](https://github.com/Developer-Autodesk/workflow-dotnet-winform-view.and.data.api/) if you are using windows or [this workflow sample in Mac OS Swift](https://github.com/Developer-Autodesk/workflow-macos-swift-view.and.data.api) if you are using Mac. But please use [staging URL](https://developer-stg.api.autodesk.com) to proceed the workflow.
62-
* Get your model urn from the workflow sample, and copy this URN in /www/views/index.js, replace the one for "urnstg", around line #23.
63-
* In /www/views/index.js, around line #28, make sure the variable staging is true.
64-
* In /www/views/index.js, around line #31, change value of tokenurl to get token through Node.js server
65-
* In /www/views/index.html, use viewer3D.min.js and style.css from staging environment
66-
* Run the server: "node server.js" from command line
67-
* Connect to server locally using a WebGL-compatible browser: http://localhost:3000/node/basic
51+
* Copy this URN in /www/views/index.js at line #18 <br />
52+
```
53+
var urnprod = 'your_urn_here';
54+
```
55+
* Run the server from the Node.js console, by running the follwing command: <br />
56+
```
57+
node server.js
58+
```
59+
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/node/basic](http://localhost:3000/node/basic)
60+
61+
#### To work with the staging environment, you need to use Option B.
62+
* Apply your own credentials from [http://developer-stg.autodesk.com](http://developer-stg.autodesk.com)
63+
* Replace the place holder with your own keys in credentials-stg.js, line #23 and #25 <br />
64+
```
65+
credentials.ClientId = '<replace with clientId>';
66+
credentials.ClientSecret = '<replace with clientSecret>';
67+
```
68+
* Upload one of your model in your account and get its URN using other workflow sample,for example, [this workflow sample in .net winform application](https://github.com/Developer-Autodesk/workflow-dotnet-winform-view.and.data.api/) if you are using windows or [this workflow sample in Mac OS Swift](https://github.com/Developer-Autodesk/workflow-macos-swift-view.and.data.api) if you are using Mac. But please use [staging URL](https://developer-stg.api.autodesk.com) to proceed with the workflows.
69+
* Copy this URN in /www/views/index.js at line #19 <br />
70+
```
71+
var urnstg = 'your_urn_here';
72+
```
73+
* In /www/views/index.js, around line #24, make sure the variable staging is true.
74+
* In /www/views/index.html (line $33 and #34), use viewer3D.min.js and style.css from the staging environment <br />
75+
```
76+
<link type="text/css" rel="stylesheet" href="https://developer-stg.api.autodesk.com/viewingservice/v1/viewers/style.css"/>
77+
<script src="https://developer-stg.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js"></script>
78+
```
79+
* Run the server from the Node.js console, by running the follwing command: <br />
80+
```
81+
node server.js
82+
```
83+
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/node/basic](http://localhost:3000/node/basic)
6884

6985

7086
## License
7187

7288
That samples are licensed under the terms of the [MIT License](http://opensource.org/licenses/MIT). Please see the [LICENSE](LICENSE) file for full details.
7389

74-
##Written by
90+
## Written by
7591

7692
Written by [Philippe Leefsma](http://adndevblog.typepad.com/cloud_and_mobile/philippe-leefsma.html)
7793

0 commit comments

Comments
 (0)