0

I have a node.js project which has a lot of literal values which constantly change every 6 months. I have an idea which is simple but I am not sure or know how to implement it.

I would like to replace these literal values with a config file which contains all these values, so when the data changes, I can just go to this config file to change these values.

Can someone please help me to do this?

mosawi
  • 1,283
  • 5
  • 25
  • 48

1 Answers1

1

Make a JSON file. On app start, read the JSON, in the callback parse it and invoke your application. Or even write a YAML and install https://github.com/nodeca/js-yaml to parse it (nicer for humans).

Amadan
  • 191,408
  • 23
  • 240
  • 301