I am building a WebThing using the Framework. I also developed my custom UI using React. I tried to specify the custom UI in the Thing, but the Gateway doesn’t show the link as expected according to this doc.
This is how I set the UI HRef:
class ThermostatThing extends Thing {
constructor() {
super('Thermostat', 'Thermostat', 'Thermostat Thing');
this.setUiHref('/index.html');
// ...
}
}
This is how I start the server to be able to serve the index.html
:
const thermostatThing = new ThermostatThing();
const server = new WebThingServer(new SingleThing(thermostatThing), 8888);
server.app.use(express.static('public'));
// ...
And this is the relevant links part for the JSON generated:
"links": [
{
"rel": "alternate",
"mediaType": "text/html",
"href": "/index.html"
}
]
Any clue why is it not working ?