开发者

Google maps api keys: dev -> staging -> production workflow

开发者 https://www.devze.com 2022-12-16 17:33 出处:网络
Does anyone have a good solution for managing the maps api key, given that: developers work locally, using localhost

Does anyone have a good solution for managing the maps api key, given that:

  • developers work locally, using localhost

  • we have a staging server, accessed internally via http://stagehost and externally (for customers) via IP address

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

Two questions:

First, how do people manage their keys in this type of scenario, given that there's always a chance for a mixup. Internal server开发者_如何学Gos are not accessible via stagehost.domain.com

Second, how can we address the staging server issue? The ip address is not accessible internally. Is this possible?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号