Google News
logo
Express.js - Interview Questions
How to Config properties in Express JS?
In Express JS, there are 2 ways that for configuring the properties:
 
With process.ENV :
 
* A file with the name “.env” is to be created within the project folder.
* All the properties are to be other within the “.env” file.
* Any of the properties will be employed in server.js.

With require.JS :
 
* A file with the name “config.json” is to be created within the config folder within the project folder.
* The config properties are to be present within the config.json file.
* Now, ought to be accustomed access the config.json file.
Advertisement