Build a blog with Areto Node.js framework

Default configuration

Create the config directory in the root of the project. It will contain the configuration files of the application.

Create a basic configuration file (config/default.js). It contains the port for the web server.

config/default.js

module.exports = {
  port: 8888
};

The basic configuration can be extended by using the files that have the same name as the value of the variable environment NODE_ENV (eg development, production).

Create the config/development.js file.

config/development.js

module.exports = {
  port: 3000
};

Now the web server will run on port 3000, if the environment variable is set to NODE_ENV=development. In another case, the server will run on port 8888 from the base configuration.