gshigeto / ionic-environment-variables

Easy to use environment variables for Ionic3!
MIT License
276 stars 36 forks source link

Suggestion: prevent environment from being stored in repo #1

Closed morphatic closed 6 years ago

morphatic commented 6 years ago

Thanks for this!

I frequently use .env files to keep API keys and other "secret stuff" from getting checked into my repo. I made a couple of minor modifications to your setup to make this work for me:

  1. Add src/environments/environment.* to ./.gitignore
  2. Added a file src/environments/sample.environment.ts that contains a basic template and instructions for what to put in environment[.dev].ts

Now I can put secret stuff in my ENV and not worry that it will show up in my repo. Secret keys will get compiled into native apps and be mostly secure. Some other solution would have to be used for PWA's.

gshigeto commented 6 years ago

Thanks for the comment!

When I use environment variables for my projects, I do ignore my files as you suggested. I will update my README to make sure to tell people to ignore their files!