File tree Expand file tree Collapse file tree 6 files changed +48
-40
lines changed Expand file tree Collapse file tree 6 files changed +48
-40
lines changed Original file line number Diff line number Diff line change @@ -32,4 +32,7 @@ credentials.js
32
32
33
33
# webstorm project files
34
34
.idea
35
- credentials_.js
35
+
36
+ .DS_store
37
+ Thumbs.db
38
+ * .bak
Original file line number Diff line number Diff line change @@ -43,11 +43,11 @@ get model URNs - as explained in the Setup/Usage Instructions.
43
43
```
44
44
cp credentials_.js credentials.js
45
45
```
46
- * Replace the placeholder with your own keys in credentials.js, line #23 and #24 <br />
46
+ * Replace the placeholders with your own keys in credentials.js, line #23 and #24 <br />
47
47
```
48
- credentials.ClientId = '<replace with your consumer key >';
48
+ credentials.ConsumerKey =process.env.CONSUMERKEY || '<replace with your consumer key >';
49
49
50
- credentials.ClientSecret = '<replace with your consumer secret >';
50
+ credentials.ConsumerSecret =process.env.CONSUMERSECRET || '<replace with your consumer secret >';
51
51
```
52
52
* In file credentials.js line #26, replace the BaseUrl address by the staging server address <br />
53
53
```
@@ -56,7 +56,7 @@ get model URNs - as explained in the Setup/Usage Instructions.
56
56
* Upload one of your models to your account and get its URN using another workflow sample, for example,
57
57
- [this workflow sample in .Net WPF application](https://github.com/Developer-Autodesk/workflow-wpf-view.and.data.api) if you are using windows
58
58
- 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
59
- - or this [WEB page](http://javalmvwalkthrough-vq2mmximxb.elasticbeanstalk.com/)
59
+ - or this [WEB page](http://models.autodesk.io/) or this [one](http:// javalmvwalkthrough-vq2mmximxb.elasticbeanstalk.com/)
60
60
* Copy the URN which was generated in the previous step in file /www/index.js at line #18 <br />
61
61
```
62
62
var defaultUrn = '<replace with your encoded urn >';
Original file line number Diff line number Diff line change @@ -34,16 +34,16 @@ get model URNs - as explained in the Setup/Usage Instructions.
34
34
```
35
35
cp credentials_.js credentials.js
36
36
```
37
- * Replace the placeholder with your own keys in credentials.js, line #23 and #24 <br />
37
+ * Replace the placeholders with your own keys in credentials.js, line #23 and #24 <br />
38
38
```
39
- credentials.ClientId = '<replace with your consumer key >';
39
+ credentials.ConsumerKey =process.env.CONSUMERKEY || '<replace with your consumer key >';
40
40
41
- credentials.ClientSecret = '<replace with your consumer secret >';
41
+ credentials.ConsumerSecret =process.env.CONSUMERSECRET || '<replace with your consumer secret >';
42
42
```
43
43
* Upload one of your models to your account and get its URN using another workflow sample, for example,
44
44
- [this workflow sample in .Net WPF application](https://github.com/Developer-Autodesk/workflow-wpf-view.and.data.api) if you are using windows
45
45
- 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
46
- - or this [WEB page](http://javalmvwalkthrough-vq2mmximxb.elasticbeanstalk.com/)
46
+ - or this [WEB page](http://models.autodesk.io/) or this [one](http:// javalmvwalkthrough-vq2mmximxb.elasticbeanstalk.com/)
47
47
* Copy the URN which was generated in the previous step in file /www/index.js at line #18 <br />
48
48
```
49
49
var defaultUrn = '<replace with your encoded urn >';
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ var credentials ={} ;
20
20
21
21
// Replace placeholder below by the Consumer Key and Consumer Secret you got from
22
22
// http://developer.autodesk.com/ for the production server
23
- credentials . ClientId = '<replace with your consumer key>' ;
24
- credentials . ClientSecret = '<replace with your consumer secret>' ;
23
+ credentials . ConsumerKey = process . env . CONSUMERKEY || '<replace with your consumer key>' ;
24
+ credentials . ConsumerSecret = process . env . CONSUMERSECRET || '<replace with your consumer secret>' ;
25
25
26
26
// If you which to use the Autodesk View & Data API on the staging server, change this url
27
27
credentials . BaseUrl = 'https://developer.api.autodesk.com' ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " AdnViewerBasic" ,
3
- "version" : " 0.0.0" ,
3
+ "description" : " A basic node.js server sample" ,
4
+ "version" : " 1.0.0" ,
4
5
"dependencies" : {
5
- "aws-sign2" : " ^0.5.0" ,
6
- "bl" : " ^0.9.4" ,
7
- "caseless" : " ^0.10.0" ,
8
- "combine-stream" : " 0.0.4" ,
9
- "combined-stream" : " 0.0.7" ,
10
- "express" : " *" ,
11
- "forever-agent" : " ^0.6.1" ,
12
- "form-data" : " ^0.2.0" ,
13
- "har-validator" : " ^1.6.1" ,
14
- "hawk" : " ^2.3.1" ,
15
- "http-signature" : " ^0.11.0" ,
16
- "isstream" : " ^0.1.2" ,
17
- "json-stringify-safe" : " ^5.0.0" ,
18
- "mime-types" : " ^2.0.10" ,
19
- "node-uuid" : " ^1.4.3" ,
20
- "oauth-sign" : " ^0.7.0" ,
21
- "qs" : " ^2.4.1" ,
22
- "request" : " *" ,
23
- "router" : " ^1.1.0" ,
24
- "serve-favicon" : " *" ,
25
- "stringstream" : " 0.0.4" ,
26
- "tough-cookie" : " ^0.13.0" ,
27
- "tunnel-agent" : " ^0.4.0"
6
+ "serve-favicon" : " >= 2.2.0" ,
7
+ "express" : " >= 4.12.3" ,
8
+ "request" : " >= 2.55.0"
9
+ },
10
+ "files" : [
11
+ " LICENSE" ,
12
+ " README.md"
13
+ ],
14
+ "engines" : {
15
+ "node" : " >= 0.10.0"
16
+ },
17
+ "contributors" : [
18
+ " Philippe Leefsma <[email protected] >"
19
+ ],
20
+ "license" : " MIT" ,
21
+ "scripts" : {
22
+ "start" : " node server.js"
23
+ },
24
+ "repository" : {
25
+ "type" : " git" ,
26
+ "url" : " https://github.com/Developer-Autodesk/workflow-node.js-view.and.data.api.git"
28
27
}
29
28
}
Original file line number Diff line number Diff line change 15
15
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
16
16
// UNINTERRUPTED OR ERROR FREE.
17
17
/////////////////////////////////////////////////////////////////////////////////
18
- var credentials = require ( '../credentials' ) ;
19
-
18
+ var fs = require ( 'fs' ) ;
19
+ var credentials ;
20
+ if ( ! fs . existsSync ( 'credentials.js' ) ) {
21
+ console . log ( 'No credentials.js file present, assuming using CONSUMERKEY & CONSUMERSECRET system variables.' ) ;
22
+ credentials = require ( '../credentials_' ) ;
23
+ } else {
24
+ credentials = require ( '../credentials' ) ;
25
+ }
20
26
var express = require ( 'express' ) ;
21
27
var request = require ( 'request' ) ;
22
28
@@ -27,10 +33,10 @@ var router = express.Router();
27
33
///////////////////////////////////////////////////////////////////////////////
28
34
router . get ( '/token' , function ( req , res ) {
29
35
var params = {
30
- client_id : credentials . ClientId ,
31
- client_secret : credentials . ClientSecret ,
36
+ client_id : credentials . ConsumerKey ,
37
+ client_secret : credentials . ConsumerSecret ,
32
38
grant_type : 'client_credentials'
33
- }
39
+ } ;
34
40
35
41
request . post (
36
42
credentials . BaseUrl + '/authentication/v1/authenticate' ,
You can’t perform that action at this time.
0 commit comments