Google maps api keys: dev & # 8594; staging & # 8594; manufacturing process

Does anyone have a good solution for managing the key of an api card, given that:

  • developers work locally using localhost

  • We have an intermediate server, access to which is via http: // stagehost and externally (for clients) through the IP address

  • finally a production server ( http://some.domain.com )

Two questions:

Firstly, how people manage their keys in this type of scenario, given that there is always room for mixing. Internal servers are not accessible through stagehost.domain.com

Secondly, how can we solve the problem of an intermediate server? IP address is not accessible internally. Is it possible?

+3
source share
1 answer

I have a table in my database that stores Google Map keys for all of my different URLs. Then I just pull out the correct key based on the URL. This allows you to use the same code for dev, test and production on 100 sites.

+1
source

Source: https://habr.com/ru/post/1728190/


All Articles