Skip to content

Commit 559978e

Browse files
authored
Merge pull request #1074 from egekorkan/ege-static-address
Add static address to quickstart examples
2 parents 8bdbba0 + b61c90f commit 559978e

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

examples/quickstart/simple-coffee-machine.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ servient.addServer(
2424
port: 8081,
2525
})
2626
);
27+
core_1.Helpers.setStaticAddress("plugfest.thingweb.io"); // comment this out if you are testing locally
2728
let waterAmount = 100;
2829
let beansAmount = 100;
2930
let milkAmount = 100;

examples/quickstart/smart-clock.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const binding_coap_1 = require("@node-wot/binding-coap");
1919
// create Servient add CoAP binding with port configuration
2020
const servient = new core_1.Servient();
2121
servient.addServer(new binding_coap_1.CoapServer(5685));
22+
core_1.Helpers.setStaticAddress("plugfest.thingweb.io"); // comment this out if you are testing locally
2223
let minuteCounter = 0;
2324
let hourCounter = 0;
2425
async function timeCount(thing) {

packages/examples/src/quickstart/simple-coffee-machine.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// This is an example Thing script which is a simple coffee machine.
1717
// You can order coffee and see the status of the resources
1818

19-
import { Servient } from "@node-wot/core";
19+
import { Servient, Helpers } from "@node-wot/core";
2020
import { HttpServer } from "@node-wot/binding-http";
2121

2222
// create Servient add HTTP binding with port configuration
@@ -27,6 +27,8 @@ servient.addServer(
2727
})
2828
);
2929

30+
Helpers.setStaticAddress("plugfest.thingweb.io"); // comment this out if you are testing locally
31+
3032
let waterAmount = 100;
3133
let beansAmount = 100;
3234
let milkAmount = 100;

packages/examples/src/quickstart/smart-clock.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@
1515

1616
// This is an example Thing which is a smart clock that runs 60 times faster than real time, where 1 hour happens in 1 minute.
1717

18-
import { Servient } from "@node-wot/core";
18+
import { Servient, Helpers } from "@node-wot/core";
1919
import { CoapServer } from "@node-wot/binding-coap";
2020

2121
// create Servient add CoAP binding with port configuration
2222
const servient = new Servient();
2323
servient.addServer(new CoapServer(5685));
2424

25+
Helpers.setStaticAddress("plugfest.thingweb.io"); // comment this out if you are testing locally
26+
2527
let minuteCounter = 0;
2628
let hourCounter = 0;
2729

0 commit comments

Comments
 (0)