Skip to content

Commit e33805d

Browse files
committed
Update README.md
1 parent ca4fb77 commit e33805d

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

README.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
#Autodesk view and data API Node.js Basic Sample
1+
# Autodesk View and Data API Node.js Basic Sample
22

33

4-
##Description
5-
6-
7-
A sample demonstrating how to load a model into web application with the Autodesk View & Data API. This web application has a basic Node.js server and JavaScript/HTML5 client
8-
9-
##Dependencies
4+
## Description
5+
A sample demonstrating how to view a model into web application with the Autodesk View & Data API. This web application has a basic Node.js server and JavaScript/HTML5 client. This sample does not demonstrate how to upload a model ont he Autodesk server for translation.
106

7+
## Dependencies
118
Install Node.js on your machine and clone this repo. Download the project' dependencies using npm before running the app by running the following command
129
```
1310
npm install
1411
```
15-
on the node.js console. This will install the following node.js modules in the project.
12+
on the node.js console. This will install the following node.js modules in the project:
1613
- express
1714
- request
1815
- serve-favicon
1916

2017
This sample does not includes the workflow of uploading models. It depends on other workflow samples to upload models, get model URN. Please follow Setup/Usage Instructions.
2118

22-
##Setup/Usage Instructions
23-
24-
You can work with production or staging Autodesk View and Data environments. By default, the project is setup with the production server.
25-
26-
With the production server, you got 2 options to setup and run this sample.
19+
## Setup/Usage Instructions
20+
Use your own credentials and upload models on your account
2721

28-
### Option A: Use [upload tool](http://still-spire-1606.herokuapp.com) online service to upload model.
29-
30-
* The [upload tool](http://still-spire-1606.herokuapp.com) provides some existing models. Choose any one of them, or upload one of your own models with [upload tool](http://still-spire-1606.herokuapp.com). The [upload tool](http://still-spire-1606.herokuapp.com) will generate a URN of the model that you need later.
22+
* Apply your own credentials from [http://developer.autodesk.com](http://developer.autodesk.com)
23+
* Replace the place holder with your own keys in credentials.js, line #23 and #25 <br />
24+
```
25+
credentials.ClientId = '<replace with clientId>';
26+
27+
credentials.ClientSecret = '<replace with clientSecret>';
28+
```
29+
* 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.
3130
* Copy this URN in /www/views/index.js at line #18 <br />
3231
```
3332
var urnprod = 'your_urn_here';
3433
```
35-
* In /www/views/index.js, at line #36, change value of tokenurl to the access token you can generate from 'http://still-spire-1606.herokuapp.com/api/rawtoken'
3634
* Run the server from the Node.js console, by running the follwing command: <br />
3735
```
3836
node server.js
3937
```
4038
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/node/basic](http://localhost:3000/node/basic)
4139

42-
### Option B: Use your own credentials and upload models on your account
43-
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-
49-
credentials.ClientSecret = '<replace with clientSecret>';
50-
```
51-
* 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.
40+
41+
This sample can also work with the Autodesk staging server (vs production) or work with someone else credentials as long you can get a valid token. By default, the project is setup with the production server, and use your own credentials. If you are interested by a different setup, see the Options below.
42+
43+
## Options
44+
45+
You can work with production or staging Autodesk View and Data environments. By default, the project is setup with the production server.
46+
47+
### Production server option: Use [upload tool](http://still-spire-1606.herokuapp.com) online service to upload model.
48+
49+
* The [upload tool](http://still-spire-1606.herokuapp.com) provides some existing models. Choose any one of them, or upload one of your own models with [upload tool](http://still-spire-1606.herokuapp.com). The [upload tool](http://still-spire-1606.herokuapp.com) will generate a URN of the model that you need later.
5250
* Copy this URN in /www/views/index.js at line #18 <br />
5351
```
5452
var urnprod = 'your_urn_here';
5553
```
54+
* In /www/views/index.js, at line #36, change value of tokenurl to the access token you can generate from 'http://still-spire-1606.herokuapp.com/api/rawtoken'
5655
* Run the server from the Node.js console, by running the follwing command: <br />
5756
```
5857
node server.js
5958
```
6059
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/node/basic](http://localhost:3000/node/basic)
6160

62-
#### To work with the staging environment, you need to use Option B.
61+
62+
### To work with the staging environment, you need to use your own credential vs the option above.
6363
* Apply your own credentials from [http://developer-stg.autodesk.com](http://developer-stg.autodesk.com)
6464
* Replace the place holder with your own keys in credentials-stg.js, line #23 and #25 <br />
6565
```

0 commit comments

Comments
 (0)