Skip to content

Commit

Permalink
Updated README with syntax and env variables info
Browse files Browse the repository at this point in the history
Signed-off-by: Murat Ereksel <murat.ereksel@imgtec.com>
  • Loading branch information
Murat Ereksel committed Nov 16, 2016
1 parent 4cc65db commit 5c13743
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Please note that you can also set the following **environment variables** for th
* CREATOR_ACCESS_KEY
* CREATOR_ACCESS_SECRET

and then

```js
var creator = require('creator-js-client')();
```

Now you should have a working instance of the library that you can use to access your resources RESTfully.

Expand Down Expand Up @@ -152,8 +157,8 @@ This will fetch you an array of your clients talking to the DeviceServer.

```js
creator.request({
method: 'PUT'
steps: ['clients', {Name: 'CLIENT_NAME'}, 'objecttypes', {ObjectTypeID: '3201'}, 'instances', {InstanceID: '0'}]
method: 'PUT',
steps: ['clients', {Name: 'CLIENT_NAME'}, 'objecttypes', {ObjectTypeID: '3201'}, 'instances', {InstanceID: '0'}],
data: {
DigitalOutputState: true
}
Expand All @@ -167,14 +172,14 @@ You can set the following options when calling the request(); method

```js
creator.request({
follow: true //defaults to true, if this is set to true steps should be provided
method: 'PUT' // defaults to GET
steps: ['accesskeys'] // steps for navigator to follow
follow: true, //defaults to true, if this is set to true steps should be provided
method: 'PUT', // defaults to GET
steps: ['accesskeys'], // steps for navigator to follow
data: {
// data if method is set to 'PUT'
}
timeout: 31000 // defaults to 31000
headers: {} // HTTP request headers are automatically set and we do not recommend overwriting them
},
timeout: 31000, // defaults to 31000
headers: {}, // HTTP request headers are automatically set and we do not recommend overwriting them
relativeEntryPoint: '/clients' // this option can be set if you know where to begin within the Creator DeviceServer API, can be useful to cut down steps
}, function(cb){});
```
Expand All @@ -185,7 +190,7 @@ To run creator-node tests first you need to open up the test/config.js file and
Thereafter, you can run the command below and initiate the mocha tests.

```js
npm test
$ npm test
```

## Help
Expand Down

0 comments on commit 5c13743

Please sign in to comment.