Score:0

Create static endpoint to point to externally hosted resources

us flag
SBB

We use a product that provides us an endpoint for javascript resources and an API endpoint. This URL is then provided to teams internally to interface with the API.

We run into issues where the service could change the endpoint during site switches or environment refreshes, resulting in us needing to coordinate with other internal teams to give them the updated endpoint, and then they have to update their product which is not ideal.

Current State:

<script type='text/javascript' src='https://c.la2-c1cs-ia7.salesforceliveagent.com/content/g/js/58.0/deployment.js'></script>
<script type='text/javascript' src='https://c.la2-c1cs-ia7.salesforceliveagent.com/content/g/js/58.0/prechat.js'></script>
<script type='text/javascript'>liveagent.init('https://d.la2-c1cs-ia7.salesforceliveagent.com/chat', 'deploymentId123', 'orgId123');</script>

I would like to provide these internal teams with a static endpoint they don't need to change and allow us to control the destination it points to in order to eliminate them from needing to make changes.

I was thinking that if we had a static endpoint, we could give the internal team and point them to the known destination.

http://static-asset-endpoint.com/prod -> https://c.la2-c1cs-ia7.salesforceliveagent.com

http://static-api-endpoint.com/prod -> https://d.la2-c1cs-ia7.salesforceliveagent.com

Possible Future State:

<script type='text/javascript' src='http://static-asset-endpoint.com/prod/content/g/js/58.0/deployment.js'></script>
<script type='text/javascript' src='http://static-asset-endpoint.com/prod/content/g/js/58.0/prechat.js'></script>
<script type='text/javascript'>liveagent.init('http://static-api-endpoint.com/prod/chat', 'deploymentId123', 'orgId123');</script>

When a change is needed, our team can update the endpoint those static URLs resolve to.

Questions:

  1. How should something like this be done?
  2. Would this be considered a proxy, or can it be done solely with DNS records?
  3. Would there be limitations with this due to CORS, etc.? They are public resources, not behind any authentication.
HBruijn avatar
in flag
DNS only works on hostnames / IP-addresses and you also want to adjust the URI path. The technical term for implementing that would be a " reverse proxy " and that may simply work out of the box or that won't work without significant tuning. - But normally when a provider offers a public API they ensure that their API users should never need to make changes on their end when the API fails over to another site or transitions to a new version. IMHO a reverse proxy feels that you're creating a needless additional abstraction layer for a scenario that you shouldn't need to solve client side.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.