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

src/middleware

This contains resources that have any server configuration, as well as a certain place to store any utility processes that can be shared across any application. We can have centralized configurations, such aslogger, cache, elk, and so on:

  • common: This has an instantiation of the logger module, which can be shared across the entire application. This module is based on winston (https://www.npmjs.com/package/winston).
  • config: This has vendor-specific implementations. We will have express configuration and express middleware defined here, as well as all the important configurations for organizing the REST API endpoints.
  • custom-middleware: This folder will have all our custom-written middleware, which we can utilize in any controller ...

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