Mesg-js: make it possible to configure server address



Currently it is only possible to configure Core address for application() with the env vars. I think it would be nice to make application({addr}) accept an options object, that way we can also configure it programatically.

This is also useful to configure addr in browser env.


I agree with you, the library should not rely on env variable but accept a config/option object.

But, we the automatic generation of the core/application library, I think we should not create any wrapper and directly expose the generated code to the dev. If I’m not mistaken, the generated constructor already accept options as parameter.


I think there is no much difference between to initialize gRPC client inside when application() is called or let consumers to do that. One small advantage of doing the initialization internally is, we can use the default ports when no option provided and open the connection right away. And with the Envoy, we can automatically connect to proxy server or Core server by detecting the environment when isn’t provided. Other way, consumers always have to set the host and do their initialization.


If it only for default config and we need to maintain a file, I recommend to directly expose the gRPC generated code to user.


solved by