Currently, I'm trying hide my API key from displaying in the network tab of a browser. Here are a few of my GET request to HERE Map, as you can see my API key is exposed:
https://1.base.maps.ls.hereapi.com/maptile/2.1/info?xnlp=CL_JSMv3.1.30.4&apikey={API_KEY}&output=json
https://1.aerial.maps.ls.hereapi.com/maptile/2.1/info?xnlp=CL_JSMv3.1.30.4&apikey={API_KEY}&output=json
https://vector.hereapi.com/v2/vectortiles/info?xnlp=CL_JSMv3.1.30.4&apikey={API_KEY}
https://4.aerial.maps.ls.hereapi.com/maptile/2.1/maptile/eedb0b6253/hybrid.day/3/1/3/512/jpg?xnlp=CL_JSMv3.1.30.4&apikey={API_KEY}
I'm trying to implement a proxy server using Express, and I'm following this guide from HERE Map, and it is still passing the API key in which is being exposed in the browser: https://developer.here.com/documentation/maps/3.1.37.1/dev_guide/topics/custom-configurations.html
const domainConfig = {};
const getoptions = {
apikey: '<API_KEY>'
};
// Vector Tile service
domainConfig[H.service.omv.Service.CONFIG_KEY] = {
baseUrl: new H.service.Url(
'https', 'custom.domain', 'v2/vectortiles/core/mc', getoptions
),
subdomain: 'subdomain' // optional, if subdomain is not needed null must be passed
};
How would I go about implementing a proxy server when there are so many possible subdomains and hide the API key?