Skip to content

Commit

Permalink
Merge pull request #1074 from egekorkan/ege-static-address
Browse files Browse the repository at this point in the history
Add static address to quickstart examples
  • Loading branch information
relu91 authored Sep 8, 2023
2 parents 8bdbba0 + b61c90f commit 559978e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
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

0 comments on commit 559978e

Please sign in to comment.