Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static address to quickstart examples #1074

Merged
merged 2 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/quickstart/simple-coffee-machine.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ servient.addServer(
port: 8081,
})
);
core_1.Helpers.setStaticAddress("plugfest.thingweb.io"); // comment this out if you are testing locally
let waterAmount = 100;
let beansAmount = 100;
let milkAmount = 100;
Expand Down
1 change: 1 addition & 0 deletions examples/quickstart/smart-clock.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const binding_coap_1 = require("@node-wot/binding-coap");
// create Servient add CoAP binding with port configuration
const servient = new core_1.Servient();
servient.addServer(new binding_coap_1.CoapServer(5685));
core_1.Helpers.setStaticAddress("plugfest.thingweb.io"); // comment this out if you are testing locally
let minuteCounter = 0;
let hourCounter = 0;
async function timeCount(thing) {
Expand Down
4 changes: 3 additions & 1 deletion packages/examples/src/quickstart/simple-coffee-machine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// This is an example Thing script which is a simple coffee machine.
// You can order coffee and see the status of the resources

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

// create Servient add HTTP binding with port configuration
Expand All @@ -27,6 +27,8 @@ servient.addServer(
})
);

Helpers.setStaticAddress("plugfest.thingweb.io"); // comment this out if you are testing locally

let waterAmount = 100;
let beansAmount = 100;
let milkAmount = 100;
Expand Down
4 changes: 3 additions & 1 deletion packages/examples/src/quickstart/smart-clock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@

// 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.

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

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

Helpers.setStaticAddress("plugfest.thingweb.io"); // comment this out if you are testing locally

let minuteCounter = 0;
let hourCounter = 0;

Expand Down