Google api config file

I recently added support for putting google api keys into a yaml config file (config/eschaton_google_api_keys.yml). This config file will allow you to add keys for environments(development, test, staging and production) as well as for specific domain names.

If there is a domain name in the config file that matches your current domain name(using ActionController::Request#domain) it will be honored over any environment keys. This allows for testing with sub domains even when in development mode.

For existing eschaton developers

Existing developers will be familiar with the GOOGLE_MAPS_API_KEY constant.
Follow these steps to start using the config file instead:

  1. Pull the latest eschaton
  2. Create the file config/eschaton_google_api_keys.yml
  3. Add any environment and domain name keys in the above file, see generators/map/templates/eschaton_google_api_keys.yml for a sample format
  4. Remove any reference to the GOOGLE_MAPS_API_KEY constant in your code.
  5. Restart your app

For new eschaton developers

The config file is now created as part of the map generator script/generate map so new developers can start using it right away.

blog comments powered by Disqus