In Node.js development, it is common that there are serveral envrionments like development, test, production and so. Corresponding to these envrioments are configurations differed from each other. Therefore, it is necessary to make these configuration consistently.
placeHolder is a signature indicating the place to be replaced by the specific envrioment value
in Bearcat, the placeHolder can be like this:
then in config.json file you can define car.num with the specific value
then in car, $Vnum and num attributes will be injected with the right value in the config.json file, both styles are supported
In Bearcat, you can write different environment configurations in the following structure:
in directory named config, you put dev and prod sub-directory named by specific envrioment, and then write the specific configurations in these directory corresponding to each environment.
In Bearcat, you can switch different environment in the following ways:
- run with env or —env args
- run with NODE_ENV
by default, the env is dev