The purpose of this project is to display the usage of dependency injection with the following 3 tools:
I've written an article on detailing on what is Dependency Injection Principle and how to implement it.
Check it out here!
- Clone the repo
git clone https://github.com/muhammadsalmanafzal/dependency-injector-example.git
- Install npm modules
npm i
- Create .env file. This can be similar to .env.example
- Run the server
npm run dev
- Now you can either send a
GET
request to the server, where you need to replace typedi withinversify
ortsyringe
to see the difference:
http://localhost:8080/robot/typedi