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

Configuration files

Let's look at some of the configuration files that we will use throughout the project, and use them to govern the project in different environments or as per the use case:

  • default.json: Node.js has an excellent module, node-config. You can find the config file in the config folder parallel to package.json. Here, you can have multiple configuration files that can be picked up based on environments. For example, default.json would be loaded first, followed by {deployment}.json, and so on. Here is a sample file:
{    "express": {        "port": 8081,        "debug": 5858,        "host": "products-service"    } }}
  • src/Index.ts: This initializes our application, by making a new object of the application defined in the middleware/config/application ...

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