OK, this may be obvious to everyone else except me.
Settings/addons/webthing > Configure thing-url-adapter - this adds the server url, and mozilla-iot will poll this url (root) to get a list of devices:
The server then responds with a list of things:
"@type": ["Light", "OnOffSwitch"],
the gateway will then query the webserver for the thing status:
The server then responds with the status:
If you toggle the thing on/off, then the iot-gateway sends a POST instead of a GET, the web server can then perform it’s I/O and reply with the same status as for the query.
I don’t know if this is the correct usage, but it seems to work, now I understand this I can also create web server devices on other platforms such as micropython.
This is what I was trying to understand.