Q:

Fetch requests goes towards the local base URL

I try to fetch data with my web-client (express-server) from my backend-service (also express-server). Locally it works fine, using environment variables to set the backend-service-url. But deployed on AWS, it won't let me fetch from my web client EC2 to my backend EC2. 
I log my environment variable for the backend-service (comes from AWS SSM Paramter Store) and it logs the correct service-url for my backend EC2 instance. 
But then it fails, because it calls 'GET host-url/service-url/endpoint' instead of 'GET service-url/endpoint'. Don't know, if this is an AWS or node.js/express problem.
That's how I call my backend:
async function callEndpoint(endpointUrl) {
    console.log("Fetching to: " + endpointUrl)
    const response = await fetch(endpointUrl, {
        method: 'GET',
    });

    let data = await response.json();
    return data;

The console.log prints out the correct value, but fetch however makes (I guess, but don't understand why) it a relative path, prefixing it with the host-url from my frontend EC2 instance IP/DNS.
Don't know, how relevant, but my servers running in Docker containers in an ECS cluster (each container on its own EC2 instance).

A:

If you're not specifying the scheme in the URL, fetch assumes that the domain root should be applied to the URL. 
fetch("external-service.domain.com/endpoint")

translates into
fetch("https://hostname/external-service.domain.com/endpoint")

Try adding https:// or the appropriate scheme to your URL.
Read more:
https://url.spec.whatwg.org/#url-writing

