Dependency Injection in Express Application

Sergey Radzishevskii

Author
ExpressJS
TypeScript

Overview 🔎

Guide how to inject dependencies in ExpressJS

Problem & Solution 🤝

There's no easy way to inject dependency in ExpressJS unless you use context that is a God Object. This guide tells you an alternative solution.

Goals/Requirements: Add some goals or requirements that helped get this project to the finish line. • Have the ability to build dependency injection container • Inject only what you need and do not pass the whole context. • Learn non-obvious benefits of dependency injection approach vs context injection.

Process 🛣

We learn both approaches context injection and dependency container injections. Find pros and cons for each process. We will find criteria that will help you choose the right approach, taking into account the specifics of your application.

Results 🎁

You will know how can easily inject components into your ExpressJS application. Why it simplifies tests and improves test coverage.

2021

Partner With Sergey
View Services

More Projects by Sergey