Skip to content

Commit 822e40f

Browse files
committed
let there be a const nightmare no more
1 parent 83afb81 commit 822e40f

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,20 @@ The readme is a WIP and the code could probably have some error handling added.
1515
Below is an example of how to use this to interact with the API for the custom types, it gets a type and writes the result to ta json file.
1616

1717
```js
18-
let Api = require('./dist/index').default;
19-
let credentials = require('./env.json');
20-
let fs = require('fs');
21-
let path = require('path')
22-
let api = new Api('slicemachine-startup', credentials.token)
18+
const Api = require('./dist/index').default;
19+
const credentials = require('./env.json');
20+
const fs = require('fs');
21+
const path = require('path')
22+
23+
24+
const api = new Api('slicemachine-startup', credentials.token)
2325

2426
async function test() {
2527
await api.login()
2628

2729
try {
28-
let response = await api.types().getOne('page');
29-
let res = await response.json();
30+
const response = await api.types().getOne('page');
31+
const res = await response.json();
3032
console.log(res)
3133
fs.writeFileSync(path.join(__dirname, 'page.json'), JSON.stringify(res, null, 2))
3234
} catch (ex) {

0 commit comments

Comments
 (0)