Skip to content

Commit 7bc7e88

Browse files
docs: fix missing start()
1 parent 4c630a4 commit 7bc7e88

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

packages/binding-coap/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ const { CoapClientFactory } = require("@node-wot/binding-coap");
3333
const servient = new Servient();
3434
servient.addClientFactory(new CoapClientFactory());
3535

36-
WoT.requestThingDescription("coap://plugfest.thingweb.io:5683/testthing")
37-
.then(async (td) => {
36+
servient
37+
.start()
38+
.then(async (WoT) => {
3839
try {
39-
const WoT = await servient.start();
40+
const td = await WoT.requestThingDescription("coap://plugfest.thingweb.io:5683/testthing");
4041
const thing = await WoT.consume(td);
4142

4243
// read property
@@ -47,7 +48,7 @@ WoT.requestThingDescription("coap://plugfest.thingweb.io:5683/testthing")
4748
}
4849
})
4950
.catch((err) => {
50-
console.error("Fetch error:", err);
51+
console.error("Start error:", err);
5152
});
5253
```
5354

packages/binding-http/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ HttpClientFactory = require("@node-wot/binding-http").HttpClientFactory;
3333
let servient = new Servient();
3434
servient.addClientFactory(new HttpClientFactory(null));
3535

36-
WoT.requestThingDescription("http://plugfest.thingweb.io:8083/testthing")
37-
.then(async (td) => {
36+
servient
37+
.start()
38+
.then(async (WoT) => {
3839
try {
39-
const WoT = await servient.start();
40+
const td = await WoT.requestThingDescription("http://plugfest.thingweb.io:8083/testthing");
4041
const thing = await WoT.consume(td);
4142

4243
// read property
@@ -47,7 +48,7 @@ WoT.requestThingDescription("http://plugfest.thingweb.io:8083/testthing")
4748
}
4849
})
4950
.catch((err) => {
50-
console.error("Fetch error:", err);
51+
console.error("Start error:", err);
5152
});
5253
```
5354

0 commit comments

Comments
 (0)