@@ -26,11 +26,11 @@ The Thing Description is located under the following uri <http://plugfest.thingw
2626
2727``` js
2828// example-client.js
29- Servient = require (" @node-wot/core" ). Servient ;
30- HttpClientFactory = require (" @node-wot/binding-http" ). HttpClientFactory ;
29+ const { Servient } = require (" @node-wot/core" );
30+ const { HttpClientFactory } = require (" @node-wot/binding-http" );
3131
3232// create Servient and add HTTP binding
33- let servient = new Servient ();
33+ const servient = new Servient ();
3434servient .addClientFactory (new HttpClientFactory (null ));
3535
3636servient
@@ -60,13 +60,11 @@ The server example produces a thing that allows for setting a property `count`.
6060
6161``` js
6262// example-server.js
63- Servient = require (" @node-wot/core" ).Servient ;
64- HttpServer = require (" @node-wot/binding-http" ).HttpServer ;
65-
66- Helpers = require (" @node-wot/core" ).Helpers ;
63+ const { Servient } = require (" @node-wot/core" );
64+ const { HttpServer } = require (" @node-wot/binding-http" );
6765
6866// create Servient add HTTP binding with port configuration
69- let servient = new Servient ();
67+ const servient = new Servient ();
7068servient .addServer (
7169 new HttpServer ({
7270 port: 8081 , // (default 8080)
@@ -110,21 +108,19 @@ The _secure_ server example shows how to add credentials and how to set up HTTPS
110108
111109``` js
112110// example-server-secure.js
113- Servient = require (" @node-wot/core" ).Servient ;
114- HttpServer = require (" @node-wot/binding-http" ).HttpServer ;
115-
116- Helpers = require (" @node-wot/core" ).Helpers ;
111+ const { Servient } = require (" @node-wot/core" );
112+ const { HttpServer } = require (" @node-wot/binding-http" );
117113
118114// create secure Servient with username & password credentials
119- let servient = new Servient ();
115+ const servient = new Servient ();
120116servient .addCredentials ({
121117 " urn:dev:wot:org:eclipse:thingweb:my-example-secure" : {
122118 username: " node-wot" ,
123119 password: " hello" ,
124120 // token: "1/mZ1edKKACtPAb7zGlwSzvs72PvhAbGmB8K1ZrGxpcNM"
125121 },
126122});
127- let httpConfig = {
123+ const httpConfig = {
128124 allowSelfSigned: true , // client configuration
129125 serverKey: " privatekey.pem" ,
130126 serverCert: " certificate.pem" ,
0 commit comments