2

Rather than having to change the URL passed in diet.listen() method on every server that I deploy my application on, there should be a better way to maintain such parameters in the application.

What options do we have to be able to manage such parameters?

Kamran Ahmed
  • 7,661
  • 4
  • 30
  • 55

1 Answers1

2

You can create a '.json' file there at the root of the application and then do a require for the same. For example:

var configuration = require('./config.json');

The example expects you to save a file named 'config.json' with all your configuration as a JSON. The configuration object will hold all your settings that you might want to make dynamic and read at runtime.

myTerminal
  • 1,596
  • 1
  • 14
  • 31
  • That seems a clean way to do that... At least I won't get conflicts while pulling the latest updated code on each server (until I change something in the default config). – Kamran Ahmed Jan 22 '17 at 10:32