2

Apologies for the basic question but im very new to NodeJS and Express

I want to have separate properties (such as db connection strings or encryption keys etc) for my local, test and production environments

I was wondering what is the best way to do this? If anyone can point to a tutorial or any best practices it would be much appreciated

Thanks Damien

Sabawoon
  • 25
  • 6
Damien
  • 4,081
  • 12
  • 75
  • 126
  • 2
    have look at this: https://www.npmjs.com/package/config – Mike Atkins Aug 21 '16 at 14:18
  • 2
    Possible duplicate of [How to store Node.js deployment settings/configuration files?](http://stackoverflow.com/questions/5869216/how-to-store-node-js-deployment-settings-configuration-files) – Meirion Hughes Aug 21 '16 at 15:47

2 Answers2

1

I would recommend dotenv which is an npm package to do exactly what you need.

dwaksman
  • 119
  • 2
  • 8
0

Both dotenv and the config package will do the trick but I think I will go with the config package

Cheers Damien

Damien
  • 4,081
  • 12
  • 75
  • 126