Skip to content

Commit c3a39f6

Browse files
committed
instructions updates
1 parent 32b5072 commit c3a39f6

File tree

7 files changed

+35
-34
lines changed

7 files changed

+35
-34
lines changed

README.md

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,71 +19,78 @@ This sample does not includes the workflow of uploading models. It depends on ot
1919
## Setup/Usage Instructions
2020
Use your own credentials and upload models on your account
2121

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 />
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 />
2424
```
2525
credentials.ClientId = '<replace with clientId>';
2626
2727
credentials.ClientSecret = '<replace with clientSecret>';
2828
```
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.
30-
* Copy this URN in /www/views/index.js at line #18 <br />
29+
* Upload one of your model in your account and get its URN using other workflow sample, for example,
30+
- [this workflow sample in .net winform application](https://github.com/Developer-Autodesk/workflow-dotnet-winform-view.and.data.api/) if you are using windows
31+
- 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
32+
- or this [WEB page](http://javalmvwalkthrough-vq2mmximxb.elasticbeanstalk.com/)
33+
* Copy this URN in /www/views/index.js at line #18 <br />
3134
```
3235
var urnprod = 'your_urn_here';
3336
```
34-
* Run the server from the Node.js console, by running the follwing command: <br />
37+
* Run the server from the Node.js console, by running the following command: <br />
3538
```
3639
node server.js
3740
```
38-
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/node/basic](http://localhost:3000/node/basic)
41+
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/](http://localhost:3000/)
3942

4043

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.
44+
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.
45+
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.
4246

4347
## Options
4448

4549
You can work with production or staging Autodesk View and Data environments. By default, the project is setup with the production server.
4650

47-
### Production server option: Use [upload tool](http://still-spire-1606.herokuapp.com) online service to upload model.
51+
### Option A: Production server option: Use [upload tool](http://still-spire-1606.herokuapp.com) online service to upload model.
4852

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.
50-
* Copy this URN in /www/views/index.js at line #18 <br />
53+
* 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.
54+
* Copy this URN in /www/views/index.js at line #18 <br />
5155
```
5256
var urnprod = 'your_urn_here';
5357
```
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'
55-
* Run the server from the Node.js console, by running the follwing command: <br />
58+
* 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'
59+
* Run the server from the Node.js console, by running the following command: <br />
5660
```
5761
node server.js
5862
```
59-
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/node/basic](http://localhost:3000/node/basic)
63+
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/](http://localhost:3000/)
6064

6165

62-
### To work with the staging environment, you need to use your own credential vs the option above.
63-
* Apply your own credentials from [http://developer-stg.autodesk.com](http://developer-stg.autodesk.com)
64-
* Replace the place holder with your own keys in credentials-stg.js, line #23 and #25 <br />
66+
### Option B: To work with the staging environment, you need to use your own credential vs the option above.
67+
* Apply your own credentials from [http://developer-stg.autodesk.com](http://developer-stg.autodesk.com)
68+
* Replace the place holder with your own keys in credentials-stg.js, line #23 and #25 <br />
6569
```
6670
credentials.ClientId = '<replace with clientId>';
6771
6872
credentials.ClientSecret = '<replace with clientSecret>';
6973
```
70-
* 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.
71-
* Copy this URN in /www/views/index.js at line #19 <br />
74+
* Upload one of your model in your account and get its URN using other workflow sample,for example,
75+
- [this workflow sample in .net winform application](https://github.com/Developer-Autodesk/workflow-dotnet-winform-view.and.data.api/) if you are using windows
76+
- 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
77+
But please use [staging URL](https://developer-stg.api.autodesk.com) to proceed with the workflows.
78+
* Copy this URN in /www/views/index.js at line #19 <br />
7279
```
7380
var urnstg = 'your_urn_here';
7481
```
75-
* In /www/views/index.js, around line #24, make sure the variable staging is true.
76-
* In /www/views/index.html (line $33 and #34), use viewer3D.min.js and style.css from the staging environment <br />
82+
* In /www/views/index.js, around line #24, make sure the variable staging is true.
83+
* In /www/views/index.html (line $33 and #34), use viewer3D.min.js and style.css from the staging environment <br />
7784
```
7885
<link type="text/css" rel="stylesheet" href="https://developer-stg.api.autodesk.com/viewingservice/v1/viewers/style.css"/>
7986
8087
<script src="https://developer-stg.api.autodesk.com/viewingservice/v1/viewers/viewer3D.min.js"></script>
8188
```
82-
* Run the server from the Node.js console, by running the follwing command: <br />
89+
* Run the server from the Node.js console, by running the following command: <br />
8390
```
8491
node server.js
8592
```
86-
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/node/basic](http://localhost:3000/node/basic)
93+
* Connect to server locally using a WebGL-compatible browser: [http://localhost:3000/](http://localhost:3000/)
8794

8895

8996
## License

routes/api.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ router.get('/token', function (req, res) {
4242
function (error, response, body) {
4343

4444
if (!error && response.statusCode == 200) {
45-
4645
res.send(body);
4746
}
4847
});
@@ -65,9 +64,7 @@ router.get('/tokenstg', function (req, res) {
6564
{ form: params },
6665

6766
function (error, response, body) {
68-
6967
if (!error && response.statusCode == 200) {
70-
7168
res.send(body);
7269
}
7370
});

server.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,12 @@ var express = require('express');
2121

2222
var app = express();
2323

24-
app.use('/node/basic', express.static(__dirname + '/www/views'));
25-
app.use(favicon(__dirname + '/www/public/images/favicon.ico'));
26-
app.use('/node/basic/api', api);
24+
app.use('/', express.static(__dirname + '/www'));
25+
app.use(favicon(__dirname + '/www/images/favicon.ico'));
26+
app.use('/api', api);
2727

2828
app.set('port', process.env.PORT || 3000);
2929

3030
var server = app.listen(app.get('port'), function() {
31-
32-
console.log('Server listening on port ' +
33-
server.address().port);
31+
console.log('Server listening on port ' + server.address().port);
3432
});

www/images/Thumbs.db

32 KB
Binary file not shown.
File renamed without changes.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
1616
// UNINTERRUPTED OR ERROR FREE.
1717
/////////////////////////////////////////////////////////////////////////////////
18-
var urnprod = 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YWRuLXZpZXdlci1nYWxsZXJ5LzBjMGMtMThiZi02MjJmLWNhNWUtOWVmMi5kd2Y=';
18+
var urnprod = 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6bW9kZWwtYXMtYS1zZXJ2aWNlMjAxNTAxMjYvU2VhdC5kd2Z4';
1919
var urnstg = 'dXJuOmFkc2sub2JqZWN0czpvcy5vYmplY3Q6YWRuLTEyLjAyLjIwMTUtMTMuNTUuMDIvQW5hbHl6ZS5kd2Y=';
2020

2121
$(document).ready(function () {
@@ -27,7 +27,6 @@ $(document).ready(function () {
2727
'/node/basic/api/' + (staging ? 'tokenstg' : 'token');
2828

2929
var config = {
30-
3130
environment : (staging ? 'AutodeskStaging' : 'AutodeskProduction')
3231
}
3332

@@ -67,7 +66,7 @@ function onError(error)
6766

6867
// Following code does not rely on Autodesk.ADN.Toolkit.Viewer.AdnViewerManager
6968
// and uses Autodesk API directly
70-
69+
//
7170
// $(document).ready(function () {
7271
//
7372
// var getToken = function() {

0 commit comments

Comments
 (0)