Update text on supplying environment key to accomodate windows users
In https://guides.emberjs.com/v2.14.0/tutorial/service/#toc_making-google-maps-available
We suggest adding a google maps key to your server runtime by starting the server with
GOOGLE_MAPS_API_KEY=<your key here> ember s
This doesn't work on windows, where it needs to be something like
set GOOGLE_MAPS_KEY <your key here>
ember s
We should specify what windows users need to do as well.
cc @danaoira
@toddjordan Thank you for the CC!
I was following the tutorial and couldnt set google maps api key as stated in the tutorials. While searching for a solution, I came accross this issue. So would like to share my solution here.
On windows I managed to add process variables with ember-cli-dotenv addon.
Install add on by ember install ember-cli-dotenv then create a file named ".env" on your root folder with following content
GOOGLE_MAPS_API_KEY=<your key here>
and create dotenv.js file inside config folder with following content
// config/dotenv.js
module.exports = function(env) {
return {
clientAllowedKeys: ['GOOGLE_MAPS_API_KEY']
};
};
then restart your ember server
I would vote for a crossplatform solution like ember-cli-dotenv.
Also, to avoid getting this error, you need also to find a recent version and do the following:
GOOGLE_MAPS_VERSION='3.31'