eclipse-thingweb / eclipse-thingweb/node-wot

[core][servient] Cannot supply static address when instantiating a servient

Open
#278 0 comments 1 reaction 0 assignees View on GitHub
core enhancement
Dominant language
TypeScript
Stars
192
Forks
100
Avg merge
3d 2h
Merged PRs (30d)
6

Description

It is possible to supply a static address for the servient with the cli config such as:
```json
{
"servient":{
"staticAddress":"localhost"
}
}
```

However, when not using the cli, it needs to be done via the Helpers class:
https://github.com/eclipse/thingweb.node-wot/blob/d647247fe14d2384653910699c3324597f606282/packages/cli/src/cli-default-servient.ts#L75

I think that it is more intuitive if this can be passed as an argument in the servient, like passing the port for the HttpServer, i.e.
```js
var servient = new Servient({"staticAddress":"localhost"})
```

Also, I do not understand why such a function should be in helpers and not in the servient.ts.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.