Skip to content

Commit

Permalink
Merge pull request #6 from snyk-tech-services/docs/fix-README
Browse files Browse the repository at this point in the history
docs: Update README with right client name
  • Loading branch information
aarlaud authored Jun 2, 2020
2 parents d58a7f4 + 437e14f commit 7ebc3d7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Check out available endpoints there => https://snyk.docs.apiary.io/#reference\
Any url used below omits the API base (https://snyk.io/api/v1):\
Example for Base documentation endpoint:
* `GET` request on `https://snyk.io/api/v1/`
* await manager.request({verb: "GET", url: '/'})
* await requestManager.request({verb: "GET", url: '/'})

### 0 - Setup your Snyk details if not already done
Following the same setup as snyk CLI, it uses the token stored in your system after a `snyk auth` or defined via env var `SNYK_TOKEN`.
Expand All @@ -47,7 +47,7 @@ Fire off your request and await it's result.

// Fire off single shot request
try{
let requestSync = await manager.request({verb: "GET", url: '/url'})
let requestSync = await requestManager.request({verb: "GET", url: '/url'})
console.log(requestSync)
} catch (err) {
console.log(err)
Expand All @@ -68,7 +68,7 @@ If some requests fails, retrieve the results in the catch, requests completed su

// Fire off single shot request
try{
let requestSync = await manager.request({verb: "GET", url: '/url'})
let requestSync = await requestManager.request({verb: "GET", url: '/url'})
console.log(requestSync)
} catch (err) {
console.log(err)
Expand Down Expand Up @@ -97,7 +97,7 @@ If some requests fails, retrieve the results in the catch, requests completed su
}
`
try {
const results = await manager.requestBulk([
const results = await requestManager.requestBulk([
{verb: "GET", url: '/'},
{verb: "POST", url: '/org/:orgID/project/:projectId/issues', body: filters },
{verb: "GET", url: '/user/:id'}])
Expand All @@ -120,7 +120,7 @@ Define as many listeners as needed to use multiple parallel streams.
If not defining custom channel name, default channel name is used in the backend `stream`


manager.on('data', {
requestManager.on('data', {
callback:(requestId, data) => {
console.log("response for request on test-channel ", requestId)
console.log(data)
Expand All @@ -129,8 +129,8 @@ If not defining custom channel name, default channel name is used in the backend
})

try {
manager.requestStream({verb: "GET", url: '/user/:id'}))
manager.requestStream({verb: "GET", url: '/'}, 'test-channel')
requestManager.requestStream({verb: "GET", url: '/user/:id'}))
requestManager.requestStream({verb: "GET", url: '/'}, 'test-channel')
} catch (err) {
console.log(err)
}
Expand Down

0 comments on commit 7ebc3d7

Please sign in to comment.