O'Reilly logo

TypeScript Microservices by Parth Ghiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring application properties 

As per the twelve-factor standards (recall the, Twelve-factor app of microservices, section in Chapter 1, Debunking Microservices), one code base should suffice for multiple environments, such as QA, dev, production, and so on. Ensure that we have the application properties file in our application, where we can specify the environment name and environment-related stuff. Config (https://www.npmjs.com/package/config) is one such module, which helps you in organizing all configurations. This module just reads configurations files in the ./config directory (it should be at the same level as package.json).

Salient features of config are as follows:

  • It can support formats such as YAML, YML, JSON, CSV, XML.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required