Dependency Injection in Express Application

Sergey Radzishevskii

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.
Like this project

Posted Sep 14, 2022

Learn how to implement Dependency Injection in ExpressJS! Simplify testing, improve coverage, and avoid the pitfalls of context-based solutions.

Likes

0

Views

10

rs-db-seeder
rs-db-seeder
Best Practices to Improving Remote Company Productivity
Best Practices to Improving Remote Company Productivity
Simple & Strong-Type Dependency Injection Container in Node
Simple & Strong-Type Dependency Injection Container in Node
Double-Entry Accounting Guide for Software Engineers — Part One
Double-Entry Accounting Guide for Software Engineers — Part One