chatbase-node icon indicating copy to clipboard operation
chatbase-node copied to clipboard

Is it possible to update the endpoints to use behind an HTTP proxy?

Open Rainymood opened this issue 5 years ago • 1 comments

Hi all,

For my current project that I'm working on we are using a reverse proxy using nginx. I found CREATE_ENDPOINT, CREATE_SET_ENDPOINT, and UPDATE_ENDPOINT here in chatbase-node/lib/Transport.js

const CREATE_ENDPOINT = 'https://chatbase-area120.appspot.com/api/message';
const CREATE_SET_ENDPOINT = 'https://chatbase-area120.appspot.com/api/messages';
const UPDATE_ENDPOINT = 'https://chatbase-area120.appspot.com/api/message/update';

We are not allowed to use https connections but have to route our external connections through an outbound gateway as follows

const CREATE_ENDPOINT = 'http://chatbase.outbound-gateway.prd.evilcorp.com.api/message';
const CREATE_SET_ENDPOINT = 'http://chatbase.outbound-gateway.prd.evilcorp.com/api/messages';
const UPDATE_ENDPOINT = 'http://chatbase.outbound-gateway.prd.evilcorp.com/api/message/update';

where nginx then takes care of rerouting the urls.

Therefore, I wonder whether it is possible to do this in a native way without having to manually change these endpoints in our /node_modules. I know that IBM Watson for example has a function .updateServiceUrl, I was wondering if there is a chatbase equivalent to this!

Kind regards, Jan

Rainymood avatar Jan 24 '20 10:01 Rainymood

See PR: https://github.com/google/chatbase-node/pull/37

Rainymood avatar Feb 24 '20 17:02 Rainymood