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.
精彩评论